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

前端 未结 17 1968
粉色の甜心
粉色の甜心 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:40

    Firstly, you need to install pip for the Python 3 installation that you want. Then you run that pip to install packages for that Python version.

    Since you have both pip and python 3 in /usr/bin, I assume they are both installed with a package manager of some sort. That package manager should also have a Python 3 pip. That's the one you should install.

    Felix' recommendation of virtualenv is a good one. If you are only testing, or you are doing development, then you shouldn't install the package in the system python. Using virtualenv, or even building your own Pythons for development, is better in those cases.

    But if you actually do want to install this package in the system python, installing pip for Python 3 is the way to go.

提交回复
热议问题