pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
Wiki

MacCompile

      
Search:  
 
 
sections
Installing from source with homebrew
Other instructions
Mountain Lion install instructions
Snow leopard install instructions.
download
Build and install
Install the SDL Frameworks
Install pyobjc (non-Leopard only)
Install Numeric
Install Universal build libjpeg & libpng
Install libjpeg (from source)
Install libpng (from source)
Install pygame
Enjoy!

Installing from source with homebrew

Other instructions

Mountain Lion install instructions

1. Installed python but using visual python version. This is based on python 2.7.x
In my system this installs files under Applications and /Library/Frameworks/Python.framework

http://www.vpython.org
From this site:

First, download and install the pure 32-bit Python, Python-2.7.3
(VPython does not work with Mac 64-bit/32-bit Python, but this 32-bit version of Python works fine on 64-bit Macs)

Second, download and install VPython-Mac-Py2.7-5.74

This includes version 1.5.1 of numpy.

The download of Python-2.7.3 is from the vpython site and designed to work with vpython.
You can use the python installer from http://www.python.org. However, you will have to install numpy.
You can get numpy from http://sourceforge.net/projects/numpy/files/

2. Installed the SDL libraries from dmg
http://www.libsdl.org/

SDL  1.2.15
SDL_mixer 1.2.12
SDL_ttf  2.0.11
SDL_image 1.2.12

3. Installed the libjpeg and libpng libraries from dmg
http://ethan.tira-thompson.com/Mac_OS_X_Ports.html

libpng v1.5.4
libjpeg 8c

4. Installed Xcode 4.4 from Apple apps. Need to add command line tools.
To do this start Xcode and go to Preferences under Xcode menu. Choose the Download tab and select Components.
Then install the Command Line Tools.

5. Installed XQuartz. Mountain Lion OS X no longer includes the X11 window system library.
This is different from Lion OS X.
http://xquartz.macosforge.org/landing/

XQuartz-2.7.2.dmg

6. Downloaded pygame tar file from 
http://pygame.org/download.shtml

pygame-1.9.1release.tar.gz 

Decompressed and extracted to create directory pygame1.9.1release

6. Before compilation of pygame:

  a. SDL_x header files refer to SDL as <SDL/SDL_yy.h> However, a SDL directory is not under
the include directory of SDL (SDL/Headers). To fix this in a simple way:

    i. Went to directory
          /Library/Frameworks/SDL.framework/Headers
     then made a link as follows:
          ln -s SDL ./

7. Changed to the pygame directory (normally pygame1.9.1release). Then switched to the super user.
However, you can use the sudo command instead.

I set the following compilation flags

export CC='/usr/bin/gcc'
export CFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -I/opt/X11/include -arch i386'
export LDFLAGS='-arch i386'
export ARCHFLAGS='-arch i386'

You must specify using the original location of X11. The mac does not have a ld.so.conf
and apparently the links generated by XQuartz in /usr do not work correctly.

8. Now execute:
   python config.py
This should find the SDL, jpeg, png, and numpy libraries

   python setup.py build
This will build in the directory before installing. It should complete with no errors.
then
   python setup.py install

9. Confirmed that it worked:

   Out of super user mode and in a terminal shell

   python
   and within python
   import pygame

   this gave no error and a simple pygame program ran fine.

GAMercier 2012-08-05

Snow leopard install instructions.

download

Build and install

Install the SDL Frameworks

Install pyobjc (non-Leopard only)

Install Numeric

Install Universal build libjpeg & libpng

pygame needs universal binaries to build right, but libpng and libjpeg sources don't build as universal binaries automatically... so you probably want to download the pre-built universal binaries for libpng & jpeg from ethan.tira-thompson.com. However you probably don't want to build against the dylib's for libpng and libjpeg if you are making an installer or will be using py2app, because then your distribution's imageext.so will not work without your clients also installing the libjpeg and libpng pacakges.
Since the package above installs both dylib and .a versions to /usr/local/lib and the build process will use the dylib versions by default, this means you probably want to delete/rename the dylib versions

Install the package

sudo rm /usr/local/lib/libpng.dylib sudo rm /usr/local/lib/libjpeg.dylib

Install libjpeg (from source)

Install libpng (from source)

Install pygame

Enjoy!

spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Oct 20, 2014

Oct 16, 2014

Oct 9, 2014

Oct 8, 2014

Oct 7, 2014

Oct 4, 2014

Oct 1, 2014

Sep 19, 2014

Sep 17, 2014

Sep 9, 2014

Sep 8, 2014

Sep 7, 2014

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)