Installing pygame on Snow Leopard's system Python 2.6
- Download http://www.libsdl.org/tmp/SDL-1.2.tar.gz
- Double-click
Xcode.tar.gz
, it un-tars asXcode
- Navigate to Xcode/SDL, double-click
SDL.xcodeproj
- Project menu->Edit Project Settings
- Choose "Build" tab, then make sure
Deployment_for_official..
is selected in the "configuration" dropdown - Scroll all the way to the bottom, change
SDKROOT_i386
andSDKROOT_ppc
to/Developer/SDKs/MacOSX10.6.sdk
and close the project settings - Make sure that "Use Base SDK",
Deployment_for_official_releases...
, "Framework", "Standard DMG" and "x86_64" are selected in the Overview menu. - Click Build (you will get warning, but it should compile with no errors)
- Copy the "SDL.framework" folder from "Xcode/build/" to "/Library/Frameworks"
- Download the pygame source and extract it
- Run ./configure.py
-
Run the following shell commands:
export CC='/usr/bin/gcc-4.0' CFLAGS='-isysroot /Developer/SDKs/MacOSX10.6.sdk -arch x86_64'
export LDFLAGS='-arch x86_64'
export ARCHFLAGS='-arch x86_64'
python setup.py build
python setup.py install
The last command may need you to use sudo
instead.
Due to a broken "reputation" system I cannot comment on Scott Lyon's post, but I will add that it worked save for one modification: For the last command, I had to specify the installation directory for the Python module like so:
sudo python setup.py install --install-lib /Library/Python/2.6/site-packages/
Have you tried installing it using easy_install or pip?
I haven't tried it yet, but I know I was about to install the needed libraries (SDL_game, etc) via port, then install pygame with
sudo easy_install pygame
Pretty important to get the latest SDL_image.framework if you want actual PNG/JPEG support:
http://www.libsdl.org/projects/SDL_image/
Otherwise it will only load Windows BMP files as you will see this during the build:
/Library/Frameworks//SDL_image.framework/SDL_image, missing required architecture x86_64 in file