【发布时间】:2015-01-03 18:43:52
【问题描述】:
我正在尝试通过 pip 下载一些包(目前是 google API) - 但我收到了以下响应:
pi@raspberrypi ~ $ sudo easy_install google-api-python-client
Searching for google-api-python-client
Best match: google-api-python-client 1.3.1
Processing google_api_python_client-1.3.1-py2.7.egg
google-api-python-client 1.3.1 is already the active version in easy-install.pth
Using /usr/local/lib/python2.7/dist-packages/google_api_python_client-1.3.1-py2.7.egg
Processing dependencies for google-api-python-client
Searching for uritemplate>=0.6
Reading http://pypi.python.org/simple/uritemplate/
Download error on http://pypi.python.org/simple/uritemplate/: [Errno -5] No address associated with hostname -- Some packages may not be found!
Reading http://pypi.python.org/simple/uritemplate/
Download error on http://pypi.python.org/simple/uritemplate/: [Errno -5] No address associated with hostname -- Some packages may not be found!
Couldn't find index page for 'uritemplate' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
Download error on http://pypi.python.org/simple/: [Errno -5] No address associated with hostname -- Some packages may not be found!
No local packages or download links found for uritemplate>=0.6
error: Could not find suitable distribution for Requirement.parse('uritemplate>=0.6')
现在,我想我会在这里而不是在 RPi.SE 上提问,因为这似乎已经在这里被问过并回答了好几次了。现在,通常情况下,这将构成 不 再次询问 - 但这些解决方案都没有帮助。
看过
仅举几例。
其中一些解决方案提到了导致此错误的代理问题 - 但是,这不是我的问题,因为我没有代理并且我的 $http_proxy 为空:
pi@raspberrypi ~ $ echo $http_proxy
pi@raspberrypi ~ $
提到的另一个问题是缺少正确的 SSL 版本,给出的解决方案是安装 pip 1.2.1……现在这似乎有点过时了。我是否需要安装特定版本的 OpenSSL/pip?
我确实安装了 pip 1.2.1,我之前有 1.1.1(来自 Raspbian 存储库的包)但得到了同样的错误。
知道是什么原因造成的吗?
编辑:这是 HTTPLib 错误吗?
我认为这是在我的 Raspberry Pi 上安装 Python 的问题,因为我在使用 httplib python 库的其他一些代码中遇到了相同的错误 ([Errno -5] No address associated with hostname)。 httplib 库中的问题肯定会解释这个问题。
注意,curl、wget 和 lynx 都可以正常工作。
【问题讨论】:
-
但是您可以从浏览器访问
https://pypi.python.org/simple/uritemplate/,使用wget或类似的东西? -
@cel 正确。我可以通过
wget和我桌面上的 Firefox 访问它。 -
抱歉,
wget在你的rpi的外壳中,对吗? -
@cel 正确,
wget在我的 Pi 上工作。 -
@cel 我认为这实际上是 httplib 的一个问题,因为我自己的一些使用 httplib 的代码也出现了完全相同的错误 - 错误 5
标签: python python-2.7 pip httplib