Proper way to install pip on Ubuntu

前端 未结 8 1369
死守一世寂寞
死守一世寂寞 2021-01-31 08:34

I\'m trying to install the latest version of pip (currently 8.1.2) on the official ubuntu/trusty64 Vagrant box. The box comes with Python 2.7.6 and 3.4.3 pre-installed with apt-

相关标签:
8条回答
  • 2021-01-31 09:15

    This worked for me on ubuntu 18.0.4:

    1- sudo apt-get update
    2- sudo apt-get upgrade
    3- sudo apt-get install python-pip
    4- pip -V
    
    0 讨论(0)
  • 2021-01-31 09:22

    The proper commands to install pip and pip3 should be the following:

    sudo apt-get install python-pip python3-pip --yes
    sudo python3 -m pip install pip --upgrade --force-reinstall
    sudo python -m pip install pip --upgrade --force-reinstall # this must come after upgrading pip3
    

    The last two lines get pip3 and pip up-to-date. The last line is critical because it re-associates pip with python 2.

    0 讨论(0)
提交回复
热议问题