I\'m having serious difficulty installing Scipy with pip on Mountain Lion. I\'ve tried:
sudo pip install -e git+https://github.com/scipy/scipy#egg=scipy-dev
Scipy is also available now via a homebrew tap. If you have homebrew installed:
brew tap samueljohn/python
brew install scipy
See more info here: homebrew-python
I tryed everything: pip, macports,easy_install,... with Mac OS El Captain. The only thing that worked for me was brew:
$ brew install scipy
After that, it will ask you to follow the instructions bellow:
$ brew link --overwrite numpy
$ mkdir -p /Users/adrieljr/Library/Python/2.7/lib/python/site-packages
$ echo 'import sys; sys.path.insert(1, "/usr/local/lib/python2.7/site-packages")' >> /Users/adrieljr/Library/Python/2.7/lib/python/site-packages/homebrew.pth
Here is what worked for me for pip installing matplotlib and scipy inside a virtual environment (Mac OS X 10.9.2 Mavericks):
# See George's answer above
brew update
brew upgrade
brew install gfortran
# See http://www.scipy.org/scipylib/building/macosx.html (the link Nathan Gould posted above)
export CXX=g++-5.1
export CC=gcc-5.1
export FFLAGS=-ff2c
sudo ln -s /usr/bin/gcc /usr/bin/gcc-5.1
sudo ln -s /usr/bin/g++ /usr/bin/g++-5.1
pip install matplotlib
pip install scipy
matplot lib installed quickly, but scipy took a long time.
I recently also had trouble getting scipy to install on a virtualenv. My problem was that gfortran was not seen properly. I used macports sudo port install gcc48
and created a symlink to just gfortran by:
sudo ln -s /opt/local/bin/gfortran-mp-4.8 /opt/local/bin/gfortran
After that, pip install scipy
worked without any errors on my virtualenv.
I had similar issues installing scipy on OSX 10.9 Mavericks as well. What solved it for me is the following:
sudo pip list
was showing numpy, thus I did:
sudo pip install --upgrade numpy
Afterwards
brew list
was showing gfortran. I made sure I had the latest version by
brew update
brew upgrade
but
sudo pip install scipy
was failing with a weird fortran error. Thus I uninstalled it and reinstalled it
sudo brew install gfortran
sudo brew uninstall gfortran
and to my great surprise
sudo pip install scipy
worked after that.
Pip has difficulties with scipy on OS X in general. It is not trivial to install from the sources, so I advise against it. In OS X you have a few better options: