简体   繁体   中英

Can't switch between pip for python 3.4 and 2.7 [Windows]

I have python 3.4 installed on my windows for a while but now I need to get 2.7 to work another project. I downloaded the 2.7.10 package from the official python and installed it. Everything was fine until I tried to install packages using pip.

What I have read in different places is that pip-2.7 should work but the command is not recognized. If I get get-pip.py to try to install pip using py get-pip.py it tells me it's already installed.

So is there anyway to get this working?

Taken from the docs

py -2 -m pip install SomePackage # default Python 2

py -2.7 -m pip install SomePackage # specifically Python 2.7

py -3 -m pip install SomePackage # default Python 3

py -3.4 -m pip install SomePackage # specifically Python 3.4

So in your case you'll need either of the two:

py -2   -m pip install SomePackage  # default Python 2
py -2.7 -m pip install SomePackage  # specifically Python 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