我正在尝试在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
,它应该可以正常工作吗?