Skip to content

Instantly share code, notes, and snippets.

@CyborgPatrick
Forked from ahankinson/gist:985173
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CyborgPatrick/9708570 to your computer and use it in GitHub Desktop.
Save CyborgPatrick/9708570 to your computer and use it in GitHub Desktop.
Install wxPython with homebrew
# These instructions work for OS X 10.6 with homebrew pre-installed.
brew install python --framework
brew install gfortran
# install other dependencies through pip:
pip install numpy
# the regular pip build for matplotlib is b0rken, and it can't find the built-in libraries for OSX
export LDFLAGS="-L/usr/X11/lib"
export CFLAGS="-I/usr/X11/include -I/usr/X11/include/freetype2 -I/usr/X11/include/libpng12"
pip install -e git+git@github.com:matplotlib/matplotlib.git#egg=matplotlib
pip install lxml
# Download the WxPython installer from the nice people at WxPython. Remember that we're going for
# the 64bit Python 2.7 Cocoa build.
# http://www.wxpython.org/download.php#unstable
# After installing wxPython we need to get it to work. Add the $PYTHONPATH environment variable
# to your shell. (mine is .zshrc, yours might be .bashrc)
export PYTHONPATH="/usr/local/lib/wxPython/lib/python2.7/site-packages/wx-2.9.1-osx_cocoa:/usr/local/lib/wxPython/lib/python2.7/site-packages:$PYTHONPATH"
# We need to do some symlinking to get everything working.
cd /usr/local/lib/python2.7
ln -s ../wxPython/lib/python2.7/wxhack.pth .
ln -s ../wxPython/lib/python2.7/wxhack.py .
# finally, we're ready to install gamera.
brew install https://github.com/ahankinson/homebrew/raw/master/Library/Formula/gamera.rb
# symlink gamera_gui into your path.
cd /usr/local/bin
ln -s ../share/python/gamera_gui .
# fix up any permissions problems so that homebrew stays happy and well fed.
cd /usr/local
sudo chown -R user:group *
@CyborgPatrick
Copy link
Author

How to correctly install wxPython on OSX 10.6 with homebrew and pip

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