Getting Pygame Set Up
Contents
Leopard
Not much trouble here.
Install Python 2.6 (or 2.5 or 2.4) using the Macintosh Installer disk image from python.org.
Install Pygame 1.9 using the Macintosh Installer disk image from pygame.org. Be sure and get the one that corresponds to your version of python.
- You are done.
Snow Leopard
If you don't already have a Python build your happy with, install your favorite Python using the Macintosh Installer disk image from python.org or get the Enthought Python distribution from enthought.com.
- Python 2.6 or 2.7 are probably fine; maybe even 2.5. These instructions will almost certainly not work with Python 3.
Install libpng using the installer hosted here.
- Install libsdl as follows:
Open up the dmg file found here: libsdl
Drag the folder that says SDL.framework into /Library/Frameworks/
- Once everything is installed successfully, paste the following into the command line, typing in your root password when prompted:
1 sudo -s
2 curl -O 'http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz'
3 export CC='/usr/bin/gcc-4.0' CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i386'
4 export LDFLAGS='-arch i386'
5 export ARCHFLAGS='-arch i386'
6 tar xf pygame-1.9.1release.tar.gz
7 cd pygame-1.9.1release
8 python setup.py config
9 python setup.py build
10 python setup.py install
11 # This should be it! You can delete the pygame-1.9.1release tarbell and folder now if you want:
12 cd ..; rm -r pygame-1.9.1release*
Lion
This method is really easy if it works, but it installs pygame into the system Python. If you want to use the Enthought Python distribution, this will not work.
Install via the package listed here: http://f0o.com/~rene/stuff/
...and you should be done! Test it by opening python and trying import pygame. If it doesn't work, the system python may not be listed first in the PATH environmental variable. Check this by typing which python at the command line. It should give /usr/bin/python. If it doesn't, insert the line export PATH=/System/Library/Frameworks/Python.Framework/Versions/Current/:$PATH at the end of the .profile file in your home directory. If that doesn't work you probably need to edit a different file like .bashrc or .bash_profile.
If that doesn't work, just do the manual install for Snow Leopard described above.
