简体   繁体   English

Python pip说:pkg_resources.DistributionNotFound:pip == 1.4.1

[英]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.

相关问题 Python pip pkg_resources.DistributionNotFound - Python pip pkg_resources.DistributionNotFound python pip 错误 pkg_resources.DistributionNotFound - python pip error pkg_resources.DistributionNotFound pip3 说“解决 pkg_resources.DistributionNotFound:pip==1.3.1” - pip3 says “resolve pkg_resources.DistributionNotFound: pip==1.3.1” Ubuntu 18.04中的PIP问题(pkg_resources.DistributionNotFound:找不到&#39;pip == 10.0.1&#39;分布,是应用程序所必需的) - PIP issue in Ubuntu 18.04 (pkg_resources.DistributionNotFound: The 'pip==10.0.1' distribution was not found and is required by the application) Easy_install和pip broken:pkg_resources.DistributionNotFound:distribute == 0.6.36 - Easy_install and pip broke: pkg_resources.DistributionNotFound: distribute==0.6.36 pkg_resources.DistributionNotFound:&#39;jsonschema&#39; - pkg_resources.DistributionNotFound: 'jsonschema' pkg_resources.DistributionNotFound:PIL - pkg_resources.DistributionNotFound: PIL python库依赖错误:pkg_resources.DistributionNotFound:pycups - python library dependency error :pkg_resources.DistributionNotFound: pycups pkg_resources.DistributionNotFound:Scrapy == 1.3.0 - pkg_resources.DistributionNotFound: Scrapy==1.3.0 对 pkg_resources.DistributionNotFound 错误进行故障排除 - Troubleshooting pkg_resources.DistributionNotFound error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM