How to use pip with Python 3.x alongside Python 2.x
The approach you should take is to install pip
for Python 3.2.
You do this in the following way:
$ curl -O https://bootstrap.pypa.io/get-pip.py
$ sudo python3.2 get-pip.py
Then, you can install things for Python 3.2 with pip-3.2
, and install things for Python 2-7 with pip-2.7
. The pip
command will end up pointing to one of these, but I'm not sure which, so you will have to check.
What you can also do is to use apt-get:
apt-get install python3-pip
In my experience this works pretty fluent too, plus you get all the benefits from apt-get.
First, install Python 3 pip using:
sudo apt-get install python3-pip
Then, to use Python 3 pip
use:
pip3 install <module-name>
For Python 2 pip
use:
pip install <module-name>