【问题标题】:easy_install pip == [Errno 8] nodename nor servname provided, or not knowneasy_install pip == [Errno 8] nodename or servname provided, or not known
【发布时间】:2012-08-09 12:26:51
【问题描述】:

我在为通过 pythonbrew 安装的 python 2.7.3 安装 pip 时遇到问题:

pythonbrew update --master
pythonbrew install 2.7.3 --force

尝试从 pip.openplans.org 获取 pip 时,这在最后阶段挂起失败:

Installed /Users/andrei/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg
Processing dependencies for distribute==0.6.28
Finished processing dependencies for distribute==0.6.28
After install bootstrap.
Don't have permissions to write /Users/andrei/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info, skipping
Creating /Users/andrei/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info
Creating /Users/andrei/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/setuptools.pth
Searching for pip
Reading http://pypi.python.org/simple/pip/
Reading http://pip.openplans.org
Download error on http://pip.openplans.org: [Errno 8] nodename nor servname provided, or not known -- Some packages may not be found!
Reading http://pip.openplans.org
Download error on http://pip.openplans.org: [Errno 8] nodename nor servname provided, or not known -- Some packages may not be found!
Reading http://pip.openplans.org
...

运行easy_install pip 也会导致同样的错误。当然,我仍然可以克隆pip repo 并手动安装它,但很高兴知道它为什么通过easy_install 失败。有什么想法吗?


更新:

$ host pip.openplans.org
pip.openplans.org is an alias for puffin.oddbird.net.
puffin.oddbird.net has address 173.203.85.138

【问题讨论】:

  • 这里无法重现。 host pip.openplans.org 带给你什么?
  • 运行dscacheutil -flushcache 并没有改善?
  • 是的!那行得通!非常感谢!请把它作为其他用户知道的答案。
  • 好了,但您的问题也可以以Too localized 结束。这当然不是特定于 python、pip 或 easy-install 的问题。

标签: python pip easy-install


【解决方案1】:

我遇到了类似的问题;该命令在 iTerm2 中失败,但在默认的 OS X 终端中没有。重启 iTerm2 解决了这个问题。

【讨论】:

  • Ughh 在这个问题上花了一个小时,直到我看到这个。感谢您提供正确的解决方案。
  • 我很想知道是什么原因导致 iterm 这样做。有时也会在尝试使用 ssh 时发生这种情况。很奇怪。
【解决方案2】:

对我来说,再次打开和关闭 WiFi 有助于 Max OS X Yosemite。

【讨论】:

  • 奇怪的是,我在 Mac OS X 中尝试使用 kafka-python 已经浪费了几个小时,而且我总是得到“提供或不知道节点名或服务名”,我不知道为什么。它在本地运行,我没想到 dns 或其他任何问题。正如你所说,我试图关闭 wifi,并没有期待太多,并且不知何故这奏效了。我只需要在没有wifi的情况下启动kafka。这很无聊,但是当我找不到其他解决方案时,我会节省一些时间。
【解决方案3】:

两件事可能是错误的:

  • pip.openplans.org 的 DNS 查找失败;使用host pip.openplans.org 进行测试。这可能是本地问题;也使用host pip.openplans.org 8.8.8.8host pip.openplans.org 8.8.4.4 对Google DNS 服务器进行测试。如果所有这些查找都失败,请向互联网大神献上一只鸡,等待改进。

  • 如果 DNS 查找没有失败,但安装失败了,那么您的本地 DNS 缓存可能会持续进行否定查找。使用命令dscacheutil -flushcache 刷新它。

【讨论】:

  • 如果使用 OSX 10.7 或 10.8,sudo killall -HUP mDNSResponder 是清除缓存的正确方法。
猜你喜欢
  • 2012-08-19
  • 1970-01-01
  • 1970-01-01
  • 2020-12-11
  • 2012-11-06
  • 2018-03-05
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多