Other answers show how to use pip with both 2.X and 3.X Python, but does not show how to handle the case of multiple Python distributions (eg. original Python and Anaconda Python).
I have a total of 3 Python versions: original Python 2.7 and Python 3.5 and Anaconda Python 3.5.
Here is how I install a package into:
Original Python 3.5:
/usr/bin/python3 -m pip install python-daemonOriginal Python 2.7:
/usr/bin/python -m pip install python-daemonAnaconda Python 3.5:
python3 -m pip install python-daemonor
pip3 install python-daemonSimpler, as Anaconda overrides original Python binaries in user environment.
Of course, installing in anaconda should be done with
condacommand, this is just an example.
Also, make sure that pip is installed for that specific python.You might need to manually install pip. This works in Ubuntu 16.04:
sudo apt-get install python-pip
or
sudo apt-get install python3-pip