100%解决pip更新问题,即使下载好了也不更新

情况描述:
为了更新python2.7 的pip版本,尝试了网上所有的方法,都没有成功。

python -m pip install --upgrade pip```
python -m pip install --upgrade pip -user
等等各种方法

查阅外网资料
In Ubuntu’s repositories many modules of python are available as packages, but they are not much in numbers as compared to PyPI (The Python Package Index). To remain consistent about upgrading a package you need to consider the method you have used initially used to install it.
就是说apt-get和pypi是不一样的,分别会安装在/usr/lib/python2.7/和/usr/local/lib/python2.7下。下面是提供的方式,但是还是没解决掉。

sudo apt-get install python-pip

最后在官网找到了方法,2步解决问题,链接点击.

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

你可能感兴趣的:(Python,python)