welcome: please sign in
location: PyGameSetup

Getting Pygame Set Up

Leopard

Not much trouble here.

  1. Install Python 2.6 (or 2.5 or 2.4) using the Macintosh Installer disk image from python.org.

  2. 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.

  3. You are done.

Snow Leopard

  1. 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.
  2. Install libpng using the installer hosted here.

  3. Install libsdl as follows:
    1. Open up the dmg file found here: libsdl

    2. Drag the folder that says SDL.framework into /Library/Frameworks/

  4. Do the same thing for sdl_image, sdl_ttf, and sdl_mixer.

  5. 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.

  1. 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.

PyGameSetup (last edited 2012-04-12 01:25:57 by JohnMcDonnell)