使用Ubuntu和python 2.7.6。当我尝试使用pip时,只需点击然后输入,
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 3095, in <module>
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 3081, in _call_aside
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 3108, in _initialize_master_working_set
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 660, in _build_master
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 673, in _build_from_requirements
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 846, in resolve
pkg_resources.DistributionNotFound: The 'pip==1.5.4' distribution was not found and is required by the application
答案 0 :(得分:5)
2017年更新(Ubuntu 17)
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
答案 1 :(得分:0)
与ubuntu 14.04,python2.7.6和pip 1.5.4面临同样的问题。 我这样做了,
sudo apt-get install --reinstall python2.7
重新安装python(虽然不是必需的)
sudo apt-get purge python-pip
(删除python pip)
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
(从此处下载,这是升级版本(9))
sudo python get-pip.py
sudo pip install package-name
这很有用!
答案 2 :(得分:0)
您可以尝试以下命令
$ hash -r