Proper way to install pip on Ubuntu

前端 未结 8 1367
死守一世寂寞
死守一世寂寞 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: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.

提交回复
热议问题