How to install python3 version of package via pip on Ubuntu?

前端 未结 17 1960
粉色の甜心
粉色の甜心 2020-11-22 11:03

I have both python2.7 and python3.2 installed in Ubuntu 12.04.
The symbolic link python links to python2.7

17条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 11:37

    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):

    1. Install package python3-setuptools: run sudo aptitude install python3-setuptools, this will give you the command easy_install3.
    2. Install pip using Python 3's setuptools: run sudo easy_install3 pip, this will give you the command pip-3.2 like kev's solution.
    3. Install your PyPI packages: run sudo pip-3.2 install (installing python packages into your base system requires root, of course).
    4. Profit!

提交回复
热议问题