点子不能安装任何东西 [英] pip cannot install anything
问题描述
> pip install yolk
Downloading/unpacking yolk
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement yolk
No distributions at all found for yolk
Storing complete log in /Users/harith/.pip/pip.log
当我阅读文件时看到
> cat /Users/harith/.pip/pip.log
------------------------------------------------------------
/Users/harith/.shared/virtualenvs/pennytracker/bin/pip run on Mon Jul 1 20:26:02 2013
Downloading/unpacking yolk
Getting page https://pypi.python.org/simple/yolk/
Could not fetch URL https://pypi.python.org/simple/yolk/: HTTP Error 503: Service Unavailable
Will skip URL https://pypi.python.org/simple/yolk/ when looking for download links for yolk
Getting page https://pypi.python.org/simple/
Could not fetch URL https://pypi.python.org/simple/: HTTP Error 503: Service Unavailable
Will skip URL https://pypi.python.org/simple/ when looking for download links for yolk
Cannot fetch index base URL https://pypi.python.org/simple/
URLs to search for versions for yolk:
* https://pypi.python.org/simple/yolk/
Getting page https://pypi.python.org/simple/yolk/
Could not fetch URL https://pypi.python.org/simple/yolk/: HTTP Error 503: Service Unavailable
Will skip URL https://pypi.python.org/simple/yolk/ when looking for download links for yolk
Could not find any downloads that satisfy the requirement yolk
No distributions at all found for yolk
Exception information:
Traceback (most recent call last):
File "/Users/harith/.shared/virtualenvs/pennytracker/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/basecommand.py", line 139, in main
status = self.run(options, args)
File "/Users/harith/.shared/virtualenvs/pennytracker/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/install.py", line 266, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Users/harith/.shared/virtualenvs/pennytracker/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 1026, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/Users/harith/.shared/virtualenvs/pennytracker/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/index.py", line 171, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for yolk
我做错什么了吗?
推荐答案
这是链接在下面的博客文章的全文:
This is the full text of the blog post linked below:
如果您最近尝试使用pip安装软件包,则可能遇到此错误:
If you've tried installing a package with pip recently, you may have encountered this error:
Could not fetch URL https://pypi.python.org/simple/Django/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:504: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>
Will skip URL https://pypi.python.org/simple/Django/ when looking for download links for Django==1.5.1 (from -r requirements.txt (line 1))
Could not fetch URL https://pypi.python.org/simple/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:504: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>
Will skip URL https://pypi.python.org/simple/ when looking for download links for Django==1.5.1 (from -r requirements.txt (line 1))
Cannot fetch index base URL https://pypi.python.org/simple/
Could not fetch URL https://pypi.python.org/simple/Django/1.5.1: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:504: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>
Will skip URL https://pypi.python.org/simple/Django/1.5.1 when looking for download links for Django==1.5.1 (from -r requirements.txt (line 1))
Could not fetch URL https://pypi.python.org/simple/Django/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:504: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>
Will skip URL https://pypi.python.org/simple/Django/ when looking for download links for Django==1.5.1 (from -r requirements.txt (line 1))
Could not find any downloads that satisfy the requirement Django==1.5.1 (from -r requirements.txt (line 1))
No distributions at all found for Django==1.5.1 (from -r requirements.txt (line 1))
Storing complete log in /Users/paul/.pip/pip.log
这似乎是旧版本的OpenSSL与pip 1.3.1不兼容的问题.如果您使用的是非库存的Python发行版(尤其是EPD 7.3),则很可能会设置不配合pip 1.3.1进行工作,而不会花费很多精力.
This seems to be an issue with an old version of OpenSSL being incompatible with pip 1.3.1. If you're using a non-stock Python distribution (notably EPD 7.3), you're very likely to have a setup that isn't going to work with pip 1.3.1 without a shitload of work.
目前最简单的解决方法是安装不需要SSL的pip 1.2.1:
The easy workaround for now, is to install pip 1.2.1, which does not require SSL:
curl -O https://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz
tar xvfz pip-1.2.1.tar.gz
cd pip-1.2.1
python setup.py install
如果您使用的是EPD,并且您没有在可能会发生问题的课堂上使用它,则可能需要考虑安装新的化身:Enthought Canopy.我知道他们知道由先前版本的OpenSSL引起的问题,并且可以想象他们现在正在使用应该与pip 1.3.1完美配合的新版本.
If you are using EPD, and you're not using it for a class where things might break, you may want to consider installing the new incarnation: Enthought Canopy. I know they were aware of the issues caused by the previous version of OpenSSL, and would imagine they are using a new version now that should play nicely with pip 1.3.1.
这篇关于点子不能安装任何东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!