[英]PIP issue in Ubuntu 18.04 (pkg_resources.DistributionNotFound: The 'pip==10.0.1' distribution was not found and is required by the application)
将Ubuntu 16.04 LTS升级到最新的Ubuntu 18.04 LTS后,使用pip
或pip3
面临此问题 :
pkg_resources.DistributionNotFound: The 'pip==10.0.1' distribution was not found and is required by the application
What seems to solve the problem. 什么似乎解决了这个问题。
Firstly, removing pip
from the computer by sudo apt-get purge python-pip
and then again reinstalling it by apt-get install python-pip python-dev build-essential
or just sudo apt-get install python-pip
wont fix the error. 首先,通过
sudo apt-get purge python-pip
pip
从计算机中删除pip
,然后通过apt-get install python-pip python-dev build-essential
再次重新安装它,或者只是sudo apt-get install python-pip
不会修复错误。 Because pip-9.0.1
is being installed by default. 因为默认安装了
pip-9.0.1
。
Actual solution 实际解决方案
Installing using curl helped, curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
and then python get-pip.py
for python 2 and python3 get-pip.py
for python 3. 使用curl安装帮助,
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
然后python get-pip.py
用于python 2和python3 get-pip.py
用于python 3。
sudo apt-get purge python-pip
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
pip --version
rm get-pip.py
Above shell command works for me! 以上shell命令对我有用! For details, please refer to: https://stackoverflow.com/a/45887255/8596899
有关详细信息,请参阅: https : //stackoverflow.com/a/45887255/8596899
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.