简体   繁体   English

pip在RHEL上显示DistributionNotFound错误

[英]pip gives DistributionNotFound error on RHEL

I'm on a work RHEL 5.4 computer with multiple versions of Python installed - definitely 2.4 and 2.7, possibly more. 我在安装了多个版本的Python的RHEL 5.4工作计算机上-肯定是2.4和2.7,甚至可能更多。 I don't want to fiddle around with uninstalling anything, as it's a standard system setup. 我不想摆弄任何东西,因为它是标准的系统设置。

I installed pip using these instructions and it appears to have been installed fine. 按照这些说明安装了pip,看来已安装正确。 After getting an invalid syntax error, I edited /usr/bin/pip so that it uses python2.7 instead of the default. 收到无效的语法错误后,我编辑了/ usr / bin / pip,使其使用python2.7而不是默认值。 Now I get the following error message whenever I call pip: 现在,每当我打电话给pip时,我都会收到以下错误消息:

Traceback (most recent call last):
  File "/usr/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/apollo/env/SDETools/lib/python2.7/site-packages/pkg_resources.py", line 2603, in <module>
    working_set.require(__requires__)
  File "/apollo/env/SDETools/lib/python2.7/site-packages/pkg_resources.py", line 666, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/apollo/env/SDETools/lib/python2.7/site-packages/pkg_resources.py", line 565, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: pip==1.5.6

I've seen a few other questions about this error on Stack Overflow, but the answers listed there don't solve it for me. 我在Stack Overflow上还看到了有关此错误的其他一些问题,但是那里列出的答案并不能为我解决。 What should I do? 我该怎么办?

In the absence of any other answer, I'll post my workaround for other people. 在没有其他答案的情况下,我会将解决方法发布给其他人。 I don't think this is a perfect solution by any means. 我认为这绝对不是一个完美的解决方案。

I did a search on the entire filesystem for pip and it came up in a couple of locations. 我在整个文件系统上进行了pip搜索,结果出现在几个位置。 One of them was specifically in a bin directory that was under the Python27 directory. 其中之一是专门在那是Python27目录下的bin目录。 Calling that one directly (with the full path) seems to now work. 现在(直接使用完整路径)调用它似乎可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM