[英]Python pip says: pkg_resources.DistributionNotFound: pip==1.4.1
I just did a clean install of Ubuntu 14.04 and also installed pycharm. 我刚刚安装了Ubuntu 14.04并安装了pycharm。 Pycharm said setuptools and pip weren't installed and offered to install it.
Pycharm表示setuptools和pip没有安装并提供安装它。 I simply clicked "Ÿes" and it seemed to install it.
我只需单击“Ÿes”,它似乎安装它。 A bit after that I wanted to install Flask (which is awesome btw) using pip, so I did
sudo pip install flask
. 之后我想用pip安装Flask(这是非常棒的btw),所以我做了
sudo pip install flask
。 To my surprise it said the following: 令我惊讶的是它说了以下内容:
Traceback (most recent call last):
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.py", line 2797, in <module>
File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 576, in resolve
def resolve(self, requirements, env=None, installer=None,
pkg_resources.DistributionNotFound: pip==1.4.1
So I simply tried the regular way: I downloaded get-pip.py and ran that, but that says: Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages
所以我只是尝试了常规方法:我下载了get-pip.py并运行了它,但是说:
Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages
I found some other similar problems here on SO, which suggested to look in /usr/local/lib/python2.7/site-packages/
, but that folder is empty. 我在SO上发现了一些其他类似的 问题 ,建议查看
/usr/local/lib/python2.7/site-packages/
,但该文件夹为空。
Does anybody know what's wrong and how I can fix this? 有人知道什么是错的,我怎么解决这个问题? All tips are welcome!
欢迎所有提示!
Had the same problem under 12.04. 在12.04下有同样的问题。
Did sudo easy_install pip==1.4.1
and it worked. sudo easy_install pip==1.4.1
并且它有效。
Faced the same problem with ubuntu 14.04 ,python2.7 and pip 1.5.4 面对ubuntu 14.04,python2.7和pip 1.5.4的同样问题
sudo apt-get install --reinstall python2.7
sudo apt-get purge python-pip
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python get-pip.py
sudo pip install package-name
This worked! 这有效!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.