Before running pip install pygame, I had also installed Command Line Tools for XCode (walkthrough), as well as XQuartz, and the following homebrew packages: brew install sdl sdl_image sdl_mixer sdl_ttf smpeg portmidi. I tried following this tutorial and replacing pip3 install pygame with conda install pygame. Installing pygame module in anaconda mac. ' brew install sdl sdl.
There were a number of unanswered questions on installing Pygame on a Mac but I am going to ask my specific question here and hope for an answer. I have been having incredible difficulty installing Pygame onto my Mac. I use the Enthought version EPD 7.3-2 32 bit and it is my default framework so if I type python at the terminal prompt I get: $ python Enthought Python Distribution (EPD) free version - www.enthought.com Version: 7.3-2 (32-bit) I have successfully installed additional modules to this version using Pip 1.2.1 with no issues. I have Xcode 4.5.2 installed on my machine but I get a gcc error.
Solved this surprisingly quickly today thanks in part to. His post was mostly correct but some parts have changed, so I’m going to document how I got it working. Note that this method will miss out PNG, SCRAP, and PORTMIDI support. Good luck getting those working!. Install Python via: brew install python. Install pip (because one package manager isn’t enough, right Python?): easyinstall pip.
Install numpy with pip: pip install numpy. Install the pre-requesites for pygame with Homebrew: brew install sdl sdlttf sdlimage sdlmixer. 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 = -lSDLttf IMAGE = -lSDLimage MIXER = -lSDLmixer Below those definitions are lines commented out that enable/disable features.
Remove the # to uncomment the ones you want. Run python setup.py install.