草庐IT

python - 使用 Python “pip” : Cannot fetch index base URL http://安装时出错

coder 2023-08-17 原文

我正在尝试安装本地版本的 ScrumDo 进行测试。只有这样我才能在我的安装中找到必须运行的 pip :

source bin/activate
pip install -r requirements.txt

我得到错误:

Downloading/unpacking django-storages

Cannot fetch index base URL http : //b.pypi.python.org/simple/
Could not find any downloads that satisfy the requirement django-storages

根本没有找到 django-storages 的发行版
将完整的日志存储在./pip-log.txt

我用谷歌搜索了一下,在这里和 Stack Overflow 上进行了搜索,发现我应该添加一个 --proxy= 选项和/或取消设置我的 http_proxy 环境变量。但是我的安装没有代理,也没有设置环境变量。我试着运行

pip install -r requirements.txt --proxy=

但错误仍然存​​在。我还创建了一个/root/.pip/pip.conf 包含:

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

并检查服务器是否确实在线,如果包 django-storages 存在,这都是真的。

自从 install doc of ScrumDo 以来,我最后尝试的一件事是这样说的:

pip install -U Django==1.1.4

还是没有成功...错误总是一样,有人有什么想法吗?

我的 pip-error.log 显示以下内容(该 URL 在同一网络中的另一台机器上的 firefox 中工作,也没有使用代理,我可以从同一台机器上 ping 它):

/var/www/ScrumDo/pinax-env/bin/pip run on Mon Jul 30 10:24:08 2012
proxy):

Downloading/unpacking Django==1.1.4
proxy):

  Getting page http://b.pypi.python.org/simple/Django
proxy):

  Could not fetch URL http://b.pypi.python.org/simple/Django: HTTP Error 404: Not Found
proxy):

  Will skip URL http://b.pypi.python.org/simple/Django when looking for download links for Django==1.1.4
proxy):

  Getting page http://b.pypi.python.org/simple/
proxy):

  Could not fetch URL http://b.pypi.python.org/simple/: HTTP Error 404: Not Found
proxy):

  Will skip URL http://b.pypi.python.org/simple/ when looking for download links for Django==1.1.4
proxy):

  Cannot fetch index base URL http://b.pypi.python.org/simple/
proxy):

  URLs to search for versions for Django==1.1.4:
proxy):

  * http://b.pypi.python.org/simple/Django/1.1.4
proxy):

  * http://b.pypi.python.org/simple/Django/
proxy):

  Getting page http://b.pypi.python.org/simple/Django/1.1.4
proxy):

  Getting page http://b.pypi.python.org/simple/Django/
proxy):

  Could not fetch URL http://b.pypi.python.org/simple/Django/1.1.4: HTTP Error 404: Not Found
proxy):

  Will skip URL http://b.pypi.python.org/simple/Django/1.1.4 when looking for download links for Django==1.1.4
proxy):

  Could not fetch URL http://b.pypi.python.org/simple/Django/: HTTP Error 404: Not Found
proxy):

  Will skip URL http://b.pypi.python.org/simple/Django/ when looking for download links for Django==1.1.4
proxy):

  Could not find any downloads that satisfy the requirement Django==1.1.4
No distributions at all found for Django==1.1.4
proxy):

Exception information:
proxy):

Traceback (most recent call last):
  File "/var/www/ScrumDo/pinax-env/lib/python2.6/site-packages/pip-0.6.1-py2.6.egg/pip.py", line 482, in main
proxy):

    self.run(options, args)
proxy):

  File "/var/www/ScrumDo/pinax-env/lib/python2.6/site-packages/pip-0.6.1-py2.6.egg/pip.py", line 675, in run
proxy):

    requirement_set.install_files(finder, force_root_egg_info=self.bundle)
proxy):

  File "/var/www/ScrumDo/pinax-env/lib/python2.6/site-packages/pip-0.6.1-py2.6.egg/pip.py", line 2422, in install_files
proxy):

    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
proxy):

proxy):

  File "/var/www/ScrumDo/pinax-env/lib/python2.6/site-packages/pip-0.6.1-py2.6.egg/pip.py", line 1485, in find_requirement
proxy):

proxy):

    raise DistributionNotFound('No distributions at all found for %s' % req)
proxy):


proxy):

DistributionNotFound: No distributions at all found for Django==1.1.4

最佳答案

如果你最近尝试过使用 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 一起使用。

目前最简单的解决方法是安装不需要 SSL 的 pip 1.2.1:

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,并且您没有将它用于可能会出现问题的类(class),您可能需要考虑安装新的化身:Enthought Canopy。我知道他们知道以前版本的 OpenSSL 引起的问题,并且可以想象他们现在使用的是新版本,应该可以很好地与 pip 1.3.1 配合使用。

关于python - 使用 Python “pip” : Cannot fetch index base URL http://安装时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11724779/

有关python - 使用 Python “pip” : Cannot fetch index base URL http://安装时出错的更多相关文章

  1. ruby - 如何使用 Nokogiri 的 xpath 和 at_xpath 方法 - 2

    我正在学习如何使用Nokogiri,根据这段代码我遇到了一些问题:require'rubygems'require'mechanize'post_agent=WWW::Mechanize.newpost_page=post_agent.get('http://www.vbulletin.org/forum/showthread.php?t=230708')puts"\nabsolutepathwithtbodygivesnil"putspost_page.parser.xpath('/html/body/div/div/div/div/div/table/tbody/tr/td/div

  2. ruby - 使用 RubyZip 生成 ZIP 文件时设置压缩级别 - 2

    我有一个Ruby程序,它使用rubyzip压缩XML文件的目录树。gem。我的问题是文件开始变得很重,我想提高压缩级别,因为压缩时间不是问题。我在rubyzipdocumentation中找不到一种为创建的ZIP文件指定压缩级别的方法。有人知道如何更改此设置吗?是否有另一个允许指定压缩级别的Ruby库? 最佳答案 这是我通过查看ruby​​zip内部创建的代码。level=Zlib::BEST_COMPRESSIONZip::ZipOutputStream.open(zip_file)do|zip|Dir.glob("**/*")d

  3. ruby - 为什么我可以在 Ruby 中使用 Object#send 访问私有(private)/ protected 方法? - 2

    类classAprivatedeffooputs:fooendpublicdefbarputs:barendprivatedefzimputs:zimendprotecteddefdibputs:dibendendA的实例a=A.new测试a.foorescueputs:faila.barrescueputs:faila.zimrescueputs:faila.dibrescueputs:faila.gazrescueputs:fail测试输出failbarfailfailfail.发送测试[:foo,:bar,:zim,:dib,:gaz].each{|m|a.send(m)resc

  4. ruby-on-rails - 使用 Ruby on Rails 进行自动化测试 - 最佳实践 - 2

    很好奇,就使用ruby​​onrails自动化单元测试而言,你们正在做什么?您是否创建了一个脚本来在cron中运行rake作业并将结果邮寄给您?git中的预提交Hook?只是手动调用?我完全理解测试,但想知道在错误发生之前捕获错误的最佳实践是什么。让我们理所当然地认为测试本身是完美无缺的,并且可以正常工作。下一步是什么以确保他们在正确的时间将可能有害的结果传达给您? 最佳答案 不确定您到底想听什么,但是有几个级别的自动代码库控制:在处理某项功能时,您可以使用类似autotest的内容获得关于哪些有效,哪些无效的即时反馈。要确保您的提

  5. ruby - 在 Ruby 中使用匿名模块 - 2

    假设我做了一个模块如下:m=Module.newdoclassCendend三个问题:除了对m的引用之外,还有什么方法可以访问C和m中的其他内容?我可以在创建匿名模块后为其命名吗(就像我输入“module...”一样)?如何在使用完匿名模块后将其删除,使其定义的常量不再存在? 最佳答案 三个答案:是的,使用ObjectSpace.此代码使c引用你的类(class)C不引用m:c=nilObjectSpace.each_object{|obj|c=objif(Class===objandobj.name=~/::C$/)}当然这取决于

  6. ruby - 使用 ruby​​ 和 savon 的 SOAP 服务 - 2

    我正在尝试使用ruby​​和Savon来使用网络服务。测试服务为http://www.webservicex.net/WS/WSDetails.aspx?WSID=9&CATID=2require'rubygems'require'savon'client=Savon::Client.new"http://www.webservicex.net/stockquote.asmx?WSDL"client.get_quotedo|soap|soap.body={:symbol=>"AAPL"}end返回SOAP异常。检查soap信封,在我看来soap请求没有正确的命名空间。任何人都可以建议我

  7. python - 如何使用 Ruby 或 Python 创建一系列高音调和低音调的蜂鸣声? - 2

    关闭。这个问题是opinion-based.它目前不接受答案。想要改进这个问题?更新问题,以便editingthispost可以用事实和引用来回答它.关闭4年前。Improvethisquestion我想在固定时间创建一系列低音和高音调的哔哔声。例如:在150毫秒时发出高音调的蜂鸣声在151毫秒时发出低音调的蜂鸣声200毫秒时发出低音调的蜂鸣声250毫秒的高音调蜂鸣声有没有办法在Ruby或Python中做到这一点?我真的不在乎输出编码是什么(.wav、.mp3、.ogg等等),但我确实想创建一个输出文件。

  8. ruby-on-rails - 'compass watch' 是如何工作的/它是如何与 rails 一起使用的 - 2

    我在我的项目目录中完成了compasscreate.和compassinitrails。几个问题:我已将我的.sass文件放在public/stylesheets中。这是放置它们的正确位置吗?当我运行compasswatch时,它不会自动编译这些.sass文件。我必须手动指定文件:compasswatchpublic/stylesheets/myfile.sass等。如何让它自动运行?文件ie.css、print.css和screen.css已放在stylesheets/compiled。如何在编译后不让它们重新出现的情况下删除它们?我自己编译的.sass文件编译成compiled/t

  9. ruby - ECONNRESET (Whois::ConnectionError) - 尝试在 Ruby 中查询 Whois 时出错 - 2

    我正在用Ruby编写一个简单的程序来检查域列表是否被占用。基本上它循环遍历列表,并使用以下函数进行检查。require'rubygems'require'whois'defcheck_domain(domain)c=Whois::Client.newc.query("google.com").available?end程序不断出错(即使我在google.com中进行硬编码),并打印以下消息。鉴于该程序非常简单,我已经没有什么想法了-有什么建议吗?/Library/Ruby/Gems/1.8/gems/whois-2.0.2/lib/whois/server/adapters/base.

  10. ruby - 使用 ruby​​ 将 HTML 转换为纯文本并维护结构/格式 - 2

    我想将html转换为纯文本。不过,我不想只删除标签,我想智能地保留尽可能多的格式。为插入换行符标签,检测段落并格式化它们等。输入非常简单,通常是格式良好的html(不是整个文档,只是一堆内容,通常没有anchor或图像)。我可以将几个正则表达式放在一起,让我达到80%,但我认为可能有一些现有的解决方案更智能。 最佳答案 首先,不要尝试为此使用正则表达式。很有可能你会想出一个脆弱/脆弱的解决方案,它会随着HTML的变化而崩溃,或者很难管理和维护。您可以使用Nokogiri快速解析HTML并提取文本:require'nokogiri'h

随机推荐