Mac launches scripts at the terminal using the command line and cannot use the python you have installed to perform scripting problems

Source: Internet
Author: User
Tags python script

2 pieces of articles are referenced:

View python location which python

First back up 1, sudo cp/usr/bin/python/usr/bin/python_cp

Delete 2, sudo rm/usr/bin/python

//The default setting is python3.5,Create a link (I'm just going to find the parser path for my installed Python, and then stitch my own path to execute the following command OK)

3, sudo ln-s/usr/bin/python3. 5/usr/bin/python

url:78017558

The 1.MAC system comes with a python environment in:

Python 2.7.10:/system/library/frameworks/python.framework/version/2.7

Where the interpreter is in this directory./bin/python2.7

Python 2.6.9:/system/library/frameworks/python.framework/version/2.6

Where the interpreter is in this directory./bin/python2.6

2. The default environment for user-installed Python environments is:

Python 3.4.2:/library/frameworks/python.framework/version/3.4

Where the interpreter is in this directory./bin/python3.4

Python 2.7.7:/library/frameworks/python.framework/version/2.7

Where the interpreter is in this directory./bin/python2.7

Url:https://www.cnblogs.com/bahcelor/p/8278711.html

To resolve the issue record:

Ah, it's done. When the Python script starts, it calls the parser to parse our script, which Python seems to be the location to return the parser, and the system uses Python parser from the system by default, so the library can't be quoted. Not your own parser is sure to find your own, and then use
Set up a parser for python2.7 (own Python) to create a link

sudo ln-s/usr/local/bin/pip2.7

Specify parser parsing and then it's OK.

To find a command for the parser path:

which Python

Mac launches scripts at the terminal using the command line and cannot use the python you have installed to perform scripting problems

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.