Skip to content

Instantly share code, notes, and snippets.

@tommct
Last active December 18, 2015 07:49
Show Gist options
  • Save tommct/5748993 to your computer and use it in GitHub Desktop.
Save tommct/5748993 to your computer and use it in GitHub Desktop.
Scientific python configuration on Mac OS X 10.9

This is my own mods to http://www.lowindata.com/2013/installing-scientific-python-on-mac-os-x/, which describes a scientific python environment install on Mac OS X. See also https://github.com/fonnesbeck/ScipySuperpack.

Install XCode and Commandline tools for XCode from Apple. Also install http://mxcl.github.io/homebrew/ and run brew update and brew doctor to make sure homebrew is installed correctly.

Then, you can run the following commands (I recommend one at a time so that you can deal with any errors or important warnings):

brew install python
brew install gfortran
pip install --upgrade pip
pip install nose
pip install numpy

From python:

import numpy
numpy.test()

Then from the command line again:

pip install scipy

From python:

import scipy
scipy.test()

Then from the terminal:

brew install pyqt
brew install pkg-config
pip install tornado

To install matplotlib, make sure freetype and libpng is also installed, and change some environment vars

brew install libpng
brew install freetype
export CC=clang
export CXX=clang++
export LDFLAGS="-L/usr/X11/lib"
export CFLAGS="-I/usr/X11/include -I/usr/X11/include/freetype2"
pip install matplotlib

TODO: CURRENT CONFIGURATION GIVES A "KERNELMAGIC" ERROR WHEN LAUNCHING IPYTHON, but otherwise works.

pip install ipython
brew install zmq
pip install pyzmq
pip install jinja2

For data analysis, I use pandas, and to connect to SQL servers pyodbc:

pip install pandas
pip install pyodbc

For other Enthought packages, such as Traits/TraitsUI:

pip install traits
pip install traitsui

To run the traitsui demos, I also had to install configobj:

pip install configobj

I also use Pyglet and PyArrayImage. First install Mercurial. Then:

hg clone https://pyglet.googlecode.com/hg/ pyglet
cd pyglet
hg pull
hg update
python setup.py install
pip install pyarrayimage

I have not been able to get vtk running yet to run mayavi2.

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