Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save saintaardvark/5810235 to your computer and use it in GitHub Desktop.
Save saintaardvark/5810235 to your computer and use it in GitHub Desktop.

How to install matplotlib, scipy, numpy, scikit learn and ipython notebook on Mountain Lion

By Austin G. Davis-Richardson

Get Homebrew and Pythonbrew

(Use their installation instructions)

Install gfortran, libpng, swig

brew install gfortran
brew install libpng
brew install swig

Install Python 2.7

pythonbrew install 2.7
pythonbrew use 2.7

Install cython (scipy needs it, but doesn't install it by default)

easy_install cython

Clone matplotlib, scipy, numpy, sklearn and ipythonotebook from fucking master

Note: don't use easy_install for scipy and numpy!
See http://stackoverflow.com/questions/12574604/scipy-install-on-mountain-lion-failing for details.

(I'm downloading master.zip because some of the repos are quite huge)

curl -L https://github.com/numpy/numpy/archive/master.zip > numpy.zip
curl -L https://github.com/matplotlib/matplotlib/archive/master.zip > matplotlib.zip
curl -L https://github.com/scipy/scipy/archive/master.zip > scipy.zip
curl -L https://github.com/scikit-learn/scikit-learn/archive/master.zip > sklearn.zip

Unzip and install

cd into each directory and python setup.py install

Install tornado and pyzmq

(IPython needs this for the Notebook)

pip install tornado
pip install pyzmq

That should work. Let me know if I forgot something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment