- Install Python via Homebrew:
brew install python
- Install pip (because one package manager isn’t enough, right Python?):
easy_install pip
- Install numpy with pip:
pip install numpy
- Install the pre-requesites for pygame with Homebrew:
brew install sdl sdl_ttf sdl_image sdl_mixer
Download the pygame source. (in my case was: pygame_version) It’s one of the top links. Extract it somewhere and go to that directory in a terminal.
- Run
python config.py
. - Fix the
Setup
file to point to your Homebrew SDL libraries, not OS X ones (which are missing stuff). Change the lines starting SDL, FONT, IMAGE, and MIXER to read:SDL = -I/usr/local/include/SDL -L/usr/local/lib -lSDL
FONT = -lSDL_ttf
IMAGE = -lSDL_image
MIXER = -lSDL_mixer
Below those definitions are lines commented out that enable/disable features. Remove the # to uncomment the ones you want. - Run
python setup.py install
.
Success!
source: http://jalada.co.uk/2011/06/17/installing-pygame-on-os-x-with-a-homebrew-python-2-7-install.html