How to install python3 version of package via pip on Ubuntu?
Solution 1:
Ubuntu 12.10+ and Fedora 13+ have a package called python3-pip
which will install pip-3.2
(or pip-3.3
, pip-3.4
or pip3
for newer versions) without needing this jumping through hoops.
I came across this and fixed this without needing the likes of wget
or virtualenvs (assuming Ubuntu 12.04):
- Install package
python3-setuptools
: runsudo aptitude install python3-setuptools
, this will give you the commandeasy_install3
. - Install pip using Python 3's setuptools: run
sudo easy_install3 pip
, this will give you the commandpip-3.2
like kev's solution. - Install your PyPI packages: run
sudo pip-3.2 install <package>
(installing python packages into your base system requires root, of course). - …
- Profit!
Solution 2:
You may want to build a virtualenv
of python3, then install packages of python3 after activating the virtualenv. So your system won't be messed up :)
This could be something like:
virtualenv -p /usr/bin/python3 py3env
source py3env/bin/activate
pip install package-name