Python easy_install pip==[Errno 8]提供了节点名或服务名,或未知

Python easy_install pip==[Errno 8]提供了节点名或服务名,或未知,python,pip,easy-install,Python,Pip,Easy Install,我在通过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.eg

我在通过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\u install pip
也会导致相同的错误。当然,我仍然可以克隆
pip
repo并手动安装它,但如果能通过
easy\u install
了解它失败的原因,我会很高兴。有什么想法吗


更新:
有两件事可能是错误的:

  • pip.openplans.org
    的DNS查找失败;使用主机pip.openplans.org进行测试。这可能是一个局部问题;使用
    主机pip.openplans.org 8.8.8.8
    主机pip.openplans.org 8.8.4.4
    对谷歌DNS服务器进行测试。如果所有这些查找都失败了,就牺牲一只鸡给网络神,等待改进

  • 如果DNS查找没有失败,但安装失败,则您的本地DNS缓存可能会保留负面查找。使用命令
    dscacheutil-flushcache
    刷新它


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

我也有类似的问题;该命令在iTerm2中失败,但在默认OS X终端中没有失败。重新启动iTerm2修复了该问题

不能在这里复制。
host pip.openplans.org
给了你什么?运行
dscacheutil-flushcache
并不能改善情况吗?是的!成功了!谢谢!请将其作为其他用户知道的答案。好了,但您的问题也可能因
太本地化而关闭。这当然不是python、pip或easy install特有的问题。
sudo killall-HUP mdnsrresponder
是在使用OSX 10.7或10.8时清除缓存的正确方法。奇怪的是,我在Mac OS X中尝试使用kafka python花了几个小时,我总是得到“提供了或不知道nodename或servname”,我不知道为什么。它在本地运行,我没想到dns会有问题。我试着像你说的那样关闭wifi,但没有太多期望,不知怎的,这起作用了。我只需要在没有wifi的情况下启动卡夫卡。这很无聊,但我会在找不到其他解决方案时节省一些时间。在我看到这个问题之前,我花了一个小时。感谢您提供了正确的解决方案。我想知道是什么原因导致iterm这样做的。有时尝试使用ssh时也会发生这种情况。很奇怪。
$ host pip.openplans.org
pip.openplans.org is an alias for puffin.oddbird.net.
puffin.oddbird.net has address 173.203.85.138