Easy_install和Pip不起作用

Fra*_*els 16 python python-2.7

当我尝试这样做时,Easy_install和Pip在python 2.7上不再起作用了:

sudo easy_install pip
Run Code Online (Sandbox Code Playgroud)

我明白了:

Traceback (most recent call last):
  File "/usr/bin/easy_install", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 2713, in <module>
    parse_requirements(__requires__), Environment()
  File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 584, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: distribute==0.6.15
Run Code Online (Sandbox Code Playgroud)

当我尝试:

sudo pip install [package]
Run Code Online (Sandbox Code Playgroud)

我明白了:

Traceback (most recent call last):
  File "/usr/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 2713, in <module>
    parse_requirements(__requires__), Environment()
  File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 584, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==0.8.2
Run Code Online (Sandbox Code Playgroud)

我已经安装了它们(是的,先删除它们),但没有结果......

谢谢!

(我已经试过这篇文章了)

Fyd*_*ydo 35

我有这个问题,因为某些原因没有安装python的分发包.按照python-distribute上的说明操作后,我开始工作了.

安装分发包如下:

$ wget https://web.archive.org/web/20100225231201/http://python-distribute.org/distribute_setup.py
$ python distribute_setup.py
Run Code Online (Sandbox Code Playgroud)

编辑:http://python-distribute.org/distribute_setup.py不再有效:

希望这将解决您的运行问题

$ sudo easy_install
Run Code Online (Sandbox Code Playgroud)

快乐的编码!


Ned*_*ily 19

如果您easy_install通过Distribute 安装了新版本,则新命令可能已安装在另一个目录中,很可能是/usr/local/bin/.但追溯显示你正在使用/usr/bin/easy_install.试试这个:

sudo /usr/local/bin/easy_install ...
Run Code Online (Sandbox Code Playgroud)

  • 仅供参考,这个修复对我有用(特别是反向 - /usr/bin/easy_install).谢谢. (4认同)

Mik*_*maa 9

尝试

  sudo easy_install Distribute 
Run Code Online (Sandbox Code Playgroud)

如果存在,但是太旧了

  sudo easy_install -U Distribute
Run Code Online (Sandbox Code Playgroud)

看起来像Distribute/setuptools(它的旧名称)搞砸了或Python包设置.如果其中任何一个没有帮助,请尝试删除完整的Python 2.7安装并从头开始重新安装所有内容.

混乱的可能原因是您使用了sudo easy_install/sudo pip和Linux发行包来混合和匹配系统范围的安装包.如果你使用pip/easy_install(不需要sudo),你应该使用virtualenv

http://pypi.python.org/pypi/virtualenv

  • 总是基于包的Linux发行版上的virtualenv!http://workaround.org/easy-install-debian (3认同)