Pygame 1.9.1 / OS X 10.6 / Python 2.7

Here you can exchange ideas on how to bend the Machine to your will. All languages welcome; if there's enough demand, sub-forums can be created.

Pygame 1.9.1 / OS X 10.6 / Python 2.7

Postby Nakor » Sat Sep 03, 2011 4:17 pm

Here is how I installed pygame 1.9.1 on Mac OS X 10.6 with Python 2.7.x

1) Install Python 2.7 from http://www.python.org/getit/ (be sure to get the OS X 10.6 version)
1.5) Update your shell's environment to pick the correct version by default by running Update Shell Profile.command in the /Applications/Python27/ directory. Make sure your shell is properly configured:
Code: Select all
python --version


2) Get and copy the following frameworks to /Library/Frameworks/:

http://www.libsdl.org/release/SDL-1.2.14.dmg (or a newer 1.2.x version. Note that you need at least 1.2.14 for it to work properly)
http://www.libsdl.org/projects/SDL_imag ... 1.2.10.dmg (or newer 1.2.x version. You need at least 1.2.10 though!)
http://www.libsdl.org/projects/SDL_ttf/ ... 2.0.10.dmg (or newer 2.0.x version)
http://www.libsdl.org/projects/SDL_mixe ... 1.2.11.dmg (or newer 1.2.x version)

3) Get and install the latest numpy release for Mac/Python2.7 from
http://numpy.scipy.org/

4) Get and install the latest libjpeg and libpng binaries from
http://ethan.tira-thompson.com/Mac_OS_X_Ports.html

4.5) Apparently, you need to delete the links to the dynamic version of these libraries before building; otherwise your pygame build will have dependencies that will make deploying your app difficult. You can always re-create the links if needed. I did this:

Code: Select all
cd /usr/local/lib
sudo rm libjpeg.dylib
sudo rm libpng.dylib


5) Get the pygame release
http://pygame.org/ftp/pygame-1.9.1release.tar.gz

Code: Select all
tar xvzf pygame-1.9.1release.tar.gz
cd pygame-1.9.1release.tar.gz
python config.py

You should see this:
Code: Select all
Hunting dependencies...
Framework SDL found
Framework SDL_ttf found
Framework SDL_image found
Framework SDL_mixer found
Framework smpeg not found
PNG     : found
JPEG    : found
SCRAP   : not found
PORTMIDI: not found
Framework CoreMidi found

Now you're ready to build and install.
Code: Select all
sudo python setup.py install
User avatar
Nakor
Site Admin
 
Posts: 402
Joined: Sat Apr 10, 2010 11:26 am

Re: Pygame 1.9.1 / OS X 10.6 / Python 2.7

Postby jwwalker » Wed Sep 14, 2011 2:15 pm

I followed these instructions, and got the same results from the "python config.py" step, but got an error from the final install step.

Code: Select all
...
running build_ext
building 'pygame.imageext' extension
creating build/temp.macosx-10.6-intel-2.7
creating build/temp.macosx-10.6-intel-2.7/src
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -Ddarwin -I/Library/Frameworks/SDL.framework/Versions/Current/Headers -I/Library/Frameworks/SDL_image.framework/Versions/Current/Headers -I/usr/local/include -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/imageext.c -o build/temp.macosx-10.6-intel-2.7/src/imageext.o
gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g build/temp.macosx-10.6-intel-2.7/src/imageext.o -L/usr/local/lib -L/usr/local/lib -lpng -ljpeg -o build/lib.macosx-10.6-intel-2.7/pygame/imageext.so -framework SDL -F/Library/Frameworks/ -framework SDL_image -F/Library/Frameworks/
ld: framework not found SDL


SDL.framework (version 1.2.14) is definitely there in /Library/Frameworks. Any idea what could be wrong?
jwwalker
 
Posts: 2
Joined: Wed Sep 14, 2011 1:48 pm

Re: Pygame 1.9.1 / OS X 10.6 / Python 2.7

Postby Nakor » Fri Sep 16, 2011 1:30 pm

Before I decided to "roll my own" procedure, I was following this procedure. It didn't take long to run into trouble, but I may have had my shell already setup as described at the top part, specifically:

Code: Select all
export CC='/usr/bin/gcc-4.0' CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i386'
export LDFLAGS='-arch i386'
export ARCHFLAGS='-arch i386'

I honestly don't know if that will make a difference or not, but it's something to try.
User avatar
Nakor
Site Admin
 
Posts: 402
Joined: Sat Apr 10, 2010 11:26 am

Re: Pygame 1.9.1 / OS X 10.6 / Python 2.7

Postby jwwalker » Mon Sep 19, 2011 6:45 pm

No joy. In fact it's still using GCC 4.2 and the 10.6 SDK in spite of these environment variables. Thanks for trying.
jwwalker
 
Posts: 2
Joined: Wed Sep 14, 2011 1:48 pm

Re: Pygame 1.9.1 / OS X 10.6 / Python 2.7

Postby Nakor » Wed Sep 21, 2011 1:36 pm

Hmm. Unfortunately I'm a neophyte when it comes to the OS X build environment. If I have time this weekend, I'll try to repeat my procedure and see if I can discover anything.
User avatar
Nakor
Site Admin
 
Posts: 402
Joined: Sat Apr 10, 2010 11:26 am

Re: Pygame 1.9.1 / OS X 10.6 / Python 2.7

Postby barvazos » Thu Dec 29, 2011 1:25 am

SDL.framework (version 1.2.14) is definitely there in /Library/Frameworks. Any idea what could be wrong?[/quote]

jwwalker, i encountered the exact same problem (config.py running fine but build can't find framework) trying to install pygame on python 3.2 for mac using the following link: http://programming.itcarlow.ie/PyGameInstall.pdf

did you manage to solve the problem?
barvazos
 
Posts: 1
Joined: Sun Dec 25, 2011 4:26 am


Return to Software Development

Who is online

Users browsing this forum: No registered users and 0 guests

cron