Skip to content

Instantly share code, notes, and snippets.

@tommct tommct/
Last active Dec 18, 2015

What would you like to do?
Scientific python configuration on Mac OS X 10.9

This is my own mods to, which describes a scientific python environment install on Mac OS X. See also

Install XCode and Commandline tools for XCode from Apple. Also install 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

Then from the command line again:

pip install scipy

From python:

import scipy

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


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 pyglet
cd pyglet
hg pull
hg update
python 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
You can’t perform that action at this time.