pip无法安装任何东西

问题描述 投票:31回答:16
> 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

我做错了吗?

python pip
16个回答
16
投票

这是以下链接的博客文章的全文:

如果您最近尝试使用pip安装软件包,则可能是您遇到此错误:

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。

现在简单的解决方法是安装pip 1.2.1,它不需要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很好地配合。


0
投票

pip有mirror support

pip --use-mirrors install yolk

从版本1.5开始,this option will be removed

1.5(未发布)

BACKWARD INCOMPATIBLE pip不再支持--use-mirrors,-M和--mirrors标志。镜像支持已被删除。为了使用镜像,使用-i或--i​​ndex-url将其指定为主索引,或使用--extra-index-url将其指定为附加索引。 (拉#1098,CVE-2013-5123)

BACKWARD INCOMPATIBLE pip默认情况下不再会删除不安全的外部URL,也不会默认安装外部托管文件。用户可以选择使用--allow-external PROJECT和--allow-insecure PROJECT来安装外部托管或不安全的文件或URL。 (拉#1055)

为日志记录输出添加了颜色,以引起对重要警告和错误的注意。 (拉#1109)

使用不安全索引,查找链接或依赖关系链接时添加了警告。 (拉#1121)


0
投票

您的系统时钟可能是过去设置的。使用date命令检查时间并将其设置为正确


0
投票

在我的情况下,https端口(443)未打开,因此我的防火墙阻止了所有流量,并且pip无法下载软件包。


0
投票

在我尝试重置网络设置后,我也遇到了这个问题。它解决了问题。


0
投票

我发生此错误消息,因为我已将Windows环境变量设置为无效的证书文件。

通过在命令提示符下键入CURL_CA_BUNDLE来检查是否有SET变量。

您可以使用SET CURL_CA_BUNDLE=覆盖当前会话

pip.log包含以下内容:

Getting page https://pypi.python.org/simple/pip/
Could not fetch URL https://pypi.python.org/simple/pip/: connection error: [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib

-1
投票

对我来说,它工作简单的sudo pip -I install <package>

正如man pip所述,-I忽略已安装的软件包,强制重新安装。


-2
投票

此问题最有可能是由DNS设置引起的:服务器无法解析域名,因此无法下载该程序包。

解:

     sudo nano /etc/network/interface

添加一行:dns-nameservers 8.8.8.8

保存文件并退出

     sudo ifdown eth0 && sudo ifup eth0

然后pip install应该正常工作。


19
投票

我曾经使用easy_install pip==1.2.1解决方法,但我随机found,如果你有这个错误,你可能在64位机器上安装了32位版本的python。

简而言之:如果你通过从源代码安装64bit版本来安装它,然后在它上面构建你的virtualenv,你将不再拥有那个pip bug。


18
投票

这是因为在pip配置中,index-url参数应该指向新的pypi url。更改~/.pip/pip.conf中的文件,或者如果您以root身份运行pip,请在:/root/.pip/pip.conf中。

可能你有这个:

 [global]
 index-url=http://f.pypi.python.org/simple

你应该改变它:

  [global]
  index-url=https://pypi.python.org/pypi/

然后一切都应该像以前一样工作。我希望它对你有所帮助。


5
投票

我遇到了同样的问题,这个错误是因为'代理设置'。下面的语法帮助我成功解决了它:

sudo pip --proxy=http://username:password@proxyURL:portNumber install yolk

2
投票

我和pip和easy_install有类似的问题:

Cannot fetch index base URL https://pypi.python.org/simple/

正如在引用的博客文章中所建议的那样,一些旧版本的OpenSSL必须存在问题,即incompatible with pip 1.3.1

安装pip-1.2.1是一种可行的解决方法。

Possibly related question

[编辑]:

这肯定发生在RHEL / CentOS 4发行版中


1
投票

解释在您的日志中:

Could not fetch URL https://pypi.python.org/simple/yolk/: HTTP Error 503: Service Unavailable

注意HTTP Error 503: Service Unavailable。当你试图这样做时,网站似乎失败了。

很高兴知道HTTP 5xx错误是服务器端错误,因此您可以知道问题不在本地网络中而是在远程网络中。

这意味着稍后再试一次;-)(和交叉手指......)(它现在对我有用。)


1
投票

我和pip 1.5.6有同样的问题。

我刚刚删除了〜/ .pip文件夹,它就像一个魅力。

rm -r ~/.pip/

1
投票

由于代理身份验证,我发生了这种情况,因此我这样做是为了解决它

export http_proxy=http://uname:[email protected]:8080
export https_proxy=http://uname:[email protected]:8080
export ftp_proxy=http://uname:[email protected]:8080

1
投票

在Virtualenv上尝试编辑pip文件,如下所示:

vi <your_virtualenv_folder>/bin/pip

查看第一行并检查它是否对应于项目文件夹,如果不是只是更改它。

#!/<your_path>/<project_folder>/<your_virtualenv_folder>/bin/python
© www.soinside.com 2019 - 2024. All rights reserved.