Install a module using pip for specific python version

后端 未结 14 960
迷失自我
迷失自我 2020-11-22 17:14

On Ubuntu 10.04 by default Python 2.6 is installed, then I have installed Python 2.7. How can I use pip install to install packages for Python 2.7.

For

14条回答
  •  没有蜡笔的小新
    2020-11-22 17:52

    Alternatively, if you want to install specific version of the package with the specific version of python, this is the way

    sudo python2.7 -m pip install pyudev=0.16
    

    if the "=" doesnt work, use ==

    x@ubuntuserv:~$ sudo python2.7 -m pip install pyudev=0.16

    Invalid requirement: 'pyudev=0.16' = is not a valid operator. Did you mean == ?

    x@ubuntuserv:~$ sudo python2.7 -m pip install pyudev==0.16

    works fine

提交回复
热议问题