问题描述
我曾尝试在OSX上使用pip install --upgrade pip
升级pip,并且pip和easy_install均不起作用.
I was tried to upgrade pip with pip install --upgrade pip
on OSX and pip and easy_install both dont work.
运行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时
When running 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
我该如何解决?
更新我找到了解决方法.
UPDATEI found the solution.
我做了cd /usr/local/lib/python2.7/site-packages && ls
在目录中找到pip-1.4.1-py2.7.egg-info
和distribute-0.6.49-py2.7.egg
.
然后按照以下步骤解决此问题.
Then the following steps fixed the issue.
-
在
/usr/local/bin/pip
在/usr/local/bin/easy_install
卷曲ez_setup.py并从中安装setuptools的其他此类问题的答案无效.它给出了以下错误.
The answers on other such questions to curl ez_setup.py and install setuptools from it didnt work. It gave the following error.
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
推荐答案
如果这样做,它将起作用:
If you do this then it will work:
cd /usr/local/lib/python2.7/site-packages && ls
在目录中找到pip-1.4.1-py2.7.egg-info
和distribute-0.6.49-py2.7.egg
.
然后通过以下步骤解决该问题:
Then the following steps fixed the issue:
- 在
/usr/local/bin/pip
中将点子版本更改为1.4.1 - 在
/usr/local/bin/easy_install
中将分发版本更改为0.6.49
- Changed the pip version to 1.4.1 in
/usr/local/bin/pip
- Changed distribute version to 0.6.49 in
/usr/local/bin/easy_install
这篇关于Easy_install和pip损坏:pkg_resources.DistributionNotFound:distribution == 0.6.36的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!