This problem is not limited to OSX: I had the same issue with pip 1.2.1 running in virtualenv 1.8.2 on Ubuntu. pip install numpy seemed to work, but then pip install scipy would fail just as above. Solution was to download the numpy sources and install them manually using python setup.py install --prefix=/path/to/my/virtual/environment. After that, pip install scipy worked.
– Maxy-BOct 27 '12 at 21:04

6

Just an update, here is the current non-virtualenv way on Mountain Lion mkdir -p build && cd build then git clone https://github.com/numpy/numpy.git then python setup.py build then python setup.py install then pip install scipy since only numpy under pip is broken, not scipy.
– Adam NelsonDec 5 '12 at 17:22

If you don't use virtualenv, then the least intrusive fix may be manually edit /usr/local/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/locations.py (Your pip version may vary). Just replace line 35 from:

After this change, you need to reinstall numpy (pip uninstall numpy; pip install numpy). The scipy can then be installed by pip correctly.

The issue is caused by a pip bug. And the solution above is according to the pip patch (suggested in the issue discussion mentioned by Lokkju) from github user qwcode. This patch seems to have been merged to main pip repository. However, I don't see an easy way to brew update pip since it's bundled with Python. So just manually making this simple fix works for me.

I just wanted to add that this solution is necessary if you are installing scipy locally, as pip 1.3.1+ requires an SSL certificiate, and pip 1.2.1 does not have this build_prefix change.
– GuillochonDec 2 '13 at 17:56