11

I have troubles installing pip for python 2.7.3 installed via pythonbrew:

pythonbrew update --master
pythonbrew install 2.7.3 --force

This fails on the final stage hanging when trying to fetch pip from pip.openplans.org:

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
...

Running easy_install pip also results in the same error. Of course, I can still clone pip repo and install it manually, but would be nice to know why it fails via easy_install. Any idea?


Update:

$ host pip.openplans.org
pip.openplans.org is an alias for puffin.oddbird.net.
puffin.oddbird.net has address 173.203.85.138
Andrei
  • 10,918
  • 12
  • 76
  • 110

3 Answers3

14

I had a similar problem; the command was failing in iTerm2, but not in the default OS X Terminal. Restarting iTerm2 fixed the issue.

WindChimes
  • 2,955
  • 4
  • 25
  • 26
7

Two things might be wrong:

  • The DNS lookup is failing for pip.openplans.org; test with host pip.openplans.org. This could be a local problem; test against the Google DNS servers too with host pip.openplans.org 8.8.8.8 and host pip.openplans.org 8.8.4.4. If all these lookups fail, sacrifice a chicken to the Internet Gods and wait for improvement.

  • If the DNS lookup is not failing, but the install is, then your local DNS cache might be holding on to a negative lookup. Flush it with the command dscacheutil -flushcache.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
2

To me, turning WiFi on and off again helped on Max OS X Yosemite.

Hauke
  • 2,554
  • 4
  • 26
  • 29
  • 1
    Oddly enough, I have lost hours trying to use kafka-python in Mac OS X and I always got "nodename nor servname provided or not known" and I had no idea why. It is running locally and I wasn't expecting a problem with dns or whatever. I tried to turn off wifi as you said, without expecting much, and somehow this worked. I just need to start kafka with no wifi. It is is boring, but I will save some time while I can't find another solution. – Ataias Reis May 21 '16 at 08:01