Using a certain Python version with pip

suggest change
pip install [package]

or:

pip2 install [package]

If you would like to install packages for Python 3, do:

pip3 install [package]

You can also install into a specific Python by running that interpreter's pip module. This page does not show that install command. The py -3.5 -c line below only prints sys.path.

On OS-X/Linux/Unix platforms it is important to be aware of the distinction between the system version of python (an upgrade of which may render your system inoperable) and the user version(s) of python. You may, depending on which you are trying to upgrade, need to prefix these commands with sudo and input a password.

Likewise on Windows some python installations, especially those that are a part of another package, can end up installed in system directories - those you will have to upgrade from a command window running in Admin mode - if you find that it looks like you need to do this it is a very good idea to check which python installation you are trying to upgrade with a command such as python -c"import sys;print(sys.path);" or py -3.5 -c"import sys;print(sys.path);" you can also check which pip you are trying to run with pip --version

If you are running & maintaining multiple versions of python I would strongly recommend reading up about the python virtualenv or venv virtual environments which allow you to isolate both the version of python and which packages are present.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents