easy_install已存在的未满足的依赖项

时间:2015-06-09 05:34:42

标签: python pip

我正在尝试在ubuntu 14-04上使用easy_install,但由于缺少setuptools 3.3

的依赖性而导致运行失败
$ easy_install
Traceback (most recent call last):
  File "/usr/local/bin/easy_install", line 5, in <module>
    from pkg_resources import load_entry_point
  ...
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 839, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'setuptools==3.3' distribution was not found and is required by the application

如果我列出我使用pip安装的内容,我可以看到我已安装setuptools 17.1.1

$ pip list | grep setuptools
setuptools (17.1.1)

我查看了easy_install的来源,这很简单。

#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==3.3','console_scripts','easy_install'
__requires__ = 'setuptools==3.3'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('setuptools==3.3', 'console_scripts', 'easy_install')()
    )

然后我编辑了该文件,并将所有提到的setuptools==3.3替换为setuptools=17.1.1

#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==17.1.1','console_scripts','easy_install'
__requires__ = 'setuptools==17.1.1'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('setuptools==17.1.1', 'console_scripts', 'easy_install')()
    )

它现在有效 - 但很明显,这不是解决问题的正确方法!

问题

  • 这是easy_install的错误吗?
  • 我可以升级easy_install来解决此问题吗?
  • 当我将pip标记添加到此问题时,我发现它已被列为easy_install的替代品。我可以将easy_install替换为pip,它应该可以正常工作吗?

0 个答案:

没有答案