Install a module using pip for specific python version

后端 未结 14 916
迷失自我
迷失自我 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:43

    For Python 3

    sudo apt-get install python3-pip
    sudo pip3 install beautifulsoup4
    

    For Python 2

    sudo apt-get install python2-pip
    sudo pip2 install beautifulsoup4
    

    On Debian/Ubuntu, pip is the command to use when installing packages for Python 2, while pip3 is the command to use when installing packages for Python 3.

提交回复
热议问题