简体   繁体   中英

How to set two different pip versions for Python 2.7 and Python 3.4?

At the moment, it appears my pip is the pip for Python 3.4

I would like this version of pip to be used for Python 2.7, and the Python 3.4 version of pip to be pip3 .

How can I do this? I tried installing both with Macports....

EDIT: In /opt/local/bin I have pip , pip-2.7 , and pip-3.4

I didn't have a Mac to test this on, but I think it may work.

First, find the path of your pip and pip3 executable. From the terminal run which pip and which pip3 .

Once you have the path open the file. The first line should be something like: #!/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4

Try changing the version from 3.4 to 2.7 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM