Skip to content

Instantly share code, notes, and snippets.

@fonnesbeck
Created June 19, 2014 03:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fonnesbeck/7de008b05e670d919b71 to your computer and use it in GitHub Desktop.
Save fonnesbeck/7de008b05e670d919b71 to your computer and use it in GitHub Desktop.
Install the Python scientific stack (a.k.a. the Scipy Superpack) via Brew and pip
#!/bin/sh
hash brew &> /dev/null
if [ $? -eq 1 ]; then
echo 'Installing Homebrew ...'
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
fi
# Ensure Homebrew formulae are updated
brew update
hash git &> /dev/null
if [ $? -eq 1 ]; then
echo 'Installing Git ...'
brew install git
fi
hash gcc &> /dev/null
if [ $? -eq 1 ]; then
echo 'No gcc detected; Installing XCode Command Line Tools ...'
xcode-select --install
fi
# Add science tap
brew tap homebrew/science
# Python tools and utilities
brew install python
brew install gfortran
pip install nose
pip install six
pip install patsy
pip install pygments
pip install sphinx
pip install cython
# IPython
brew install zeromq
pip install jinja2
pip install tornado
pip install pyzmq
pip install ipython
# OpenBLAS for NumPy/SciPy
brew install openblas
export BLAS=/usr/local/opt/openblas/lib/libopenblas.a
export LAPACK=/usr/local/opt/openblas/lib/libopenblas.a
# Build from cloned repo to avoid SciPy build issue
git clone git@github.com:numpy/numpy.git numpy_temp
cd numpy_temp
python setupegg.py bdist_egg
easy_install dist/*egg
cd ..
rm -rf numpy_temp
# SciPy
pip install git+git://github.com/scipy/scipy#egg=scipy-dev
# Matplotlib
brew install freetype
pip install git+git://github.com/matplotlib/matplotlib.git
# Rest of the stack
pip install git+git://github.com/pydata/pandas.git
pip install git+git://github.com/scikit-learn/scikit-learn.git
pip install git+git://github.com/pymc-devs/pymc.git@2.3
pip install git+git://github.com/statsmodels/statsmodels.git
pip install git+git://github.com/Theano/Theano.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment