我正在尝试安装 ScrumDo 的本地版本进行测试。只有这样,我才能在安装过程中运行:
源 bin/activate
pip install -r requirements.txt
我收到错误:
下载/解压 django-storages
无法获取索引基本 URL http://b.pypi.python.org/simple/
找不到满足要求 django-storages 的任何下载根本找不到 django-storages 的发行版,
将完整日志存储在 ./pip-log.txt 中
我搜索了一下,并在这里和 Stack Overflow 上搜索,发现我应该添加 --proxy= 选项和/或取消设置我的 http_proxy 环境变量。但我的安装没有代理,环境变量未设置。我尝试运行
pip 安装 -r 要求.txt --proxy=
但错误仍然相同。我还创建了一个 /root/.pip/pip.conf,其中包含:
[全局]
index-url = http://b.pypi.python.org/simple
并检查服务器是否确实在线,以及包 django-storages 是否存在,这两项都是正确的。
我最后尝试了一件事,因为ScrumDo 安装文档这么说吧:
pip 安装 -U Django==1.1.4
再次没有成功...错误总是保持不变,有人有什么想法吗?
我的 pip-error.log 显示以下内容(该 URL 在同一网络中的另一台机器上的 Firefox 中有效,并且不使用代理):
/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
答案1
使用以下命令对我有帮助。请尝试一下
升级 pip python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --upgrade pip
用于安装新包,例如 numpy、pandas 等。python -m pip install 包名称 --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org
答案2
我收到了完全相同的消息,甚至来自 wget:
--2012-10-10 14:18:58-- http://pypi.python.org/simple/Django/
2012-10-10 14:18:58 ERROR 404: Not Found (Django does not have any releases).
这很奇怪,该 URL 在另一台计算机上工作正常,并且获取主页的工作也正常。
编辑:就我而言,我已将 IP 缓存在 PyPI 的 /etc/hosts 文件中,并且它正在访问该 IP,这不起作用。删除它并让它使用正常的 DNS 解析程序后,它就起作用了。