我试图pip install --upgrade pip
在 OSX 上升级 pip 并且 pip 和 easy_install 都不起作用。
运行 pip 时
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/distribute-0.6.49-py2.7.egg/pkg_resources.py", line 2881, in <module>
parse_requirements(__requires__), Environment()
File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/distribute-0.6.49-py2.7.egg/pkg_resources.py", line 596, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==1.3.1
运行 easy_install 时
File "/usr/local/bin/easy_install", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/distribute-0.6.49-py2.7.egg/pkg_resources.py", line 2881, in <module>
parse_requirements(__requires__), Environment()
File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/distribute-0.6.49-py2.7.egg/pkg_resources.py", line 596, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: distribute==0.6.36
我怎样才能解决这个问题?
更新 我找到了解决方案。
我做了cd /usr/local/lib/python2.7/site-packages && ls
找到pip-1.4.1-py2.7.egg-info
并distribute-0.6.49-py2.7.egg
在目录中。
然后以下步骤解决了该问题。
将 pip 版本更改为 1.4.1 in
/usr/local/bin/pip
将分发版本更改为 0.6.49 in
/usr/local/bin/easy_install
curl ez_setup.py 并从中安装 setuptools 的其他此类问题的答案不起作用。它给出了以下错误。
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-1.1.6.tar.gz
Traceback (most recent call last):
File "<stdin>", line 370, in <module>
File "<stdin>", line 366, in main
File "<stdin>", line 278, in download_setuptools
File "<stdin>", line 185, in download_file_curl
File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 542, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['curl', 'https://pypi.python.org/packages/source/s/setuptools/setuptools-1.1.6.tar.gz', '--silent', '--output', '/usr/bin/setuptools-1.1.6.tar.gz']' returned non-zero exit status 23