“pkg_resources.DistributionNotFound” at pip and easy install

我只是一个虾纸丫 提交于 2019-12-13 00:16:51

问题


I have to install a package via pip (in detail: the package lxml) into Python2.7 on our server (running on ScientificLinux). There is running Python 2.6 and 2.7.

The command pip points to our Python2.6 installation where the package already exists. When I try to run pip-2.7, he is throwing the following errors:

 Traceback (most recent call last):
  File "/usr/local/bin/pip-2.7", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2659, in <module>
    parse_requirements(__requires__), Environment()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==1.4.1

Thats a well known problem here (Link), but the accepted answer doesn't work. When I want to upgrade pip via easy_install, I get a similar error like the one above:

Traceback (most recent call last):
  File "/usr/local/bin/easy_install", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2659, in <module>
    parse_requirements(__requires__), Environment()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: distribute==0.6.49

I found already a possible solution here, but it also doesn't help, the versions are set right :/


回答1:


Have you tried using one of the installers on Christopher Gohlke's site? This is a tremendous resource for Windows users (I myself have found them extremely helpful.) He has a number of lxml installers.



来源:https://stackoverflow.com/questions/20282679/pkg-resources-distributionnotfound-at-pip-and-easy-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!