You can, of course put it anywhere and then update your PYTHONPATH to include it. Python packages on my mac live in
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site_packages Beware that you may need to muck with one of the .pth files so the interpreter will correctly build its internal sys.path
edit: Somehow, at some point, I ended up with two Python.framework directories: One in /System/Library/Frameworks and the other as noted above. It was impossible to decide where to put packages; and the chaos was general. I eventually copied everything to the /Library/Frameworks/Python.framework location and placed a symbolic link in the /System/Library/Frameworks directory that referenced the real Python.framework location. That worked well.
griswolf
Veteran Poster
1,165 posts since Apr 2010
Reputation Points: 344
Solved Threads: 256
I don't do pygame, so my experience is not precisely germane. Look in your site-packages for a fie named *.pth that contains some reference to your pygame egg/folder/zip file (?). Can you add a line like the other lines that does the work (
A very quick Google search yielded this information , which I did not follow through. It does appear to be pretty straight forward.
edit: But you are using Python 3.x and pygame may or may not work with 3.1. Can I talk you into using Python 2.7?
griswolf
Veteran Poster
1,165 posts since Apr 2010
Reputation Points: 344
Solved Threads: 256
I figured "how hard could it be" and went to do it myself. Oops. Worked fine for 2.6, but no luck on 2.7. Spelunking around a little more, I found this:I recently installed PyGame 1.9.1 on Mac OS X 10.6 (Snow Leopard) running Python 3.1 - check out the instructions at the bottom of this page: http://programming.itcarlow.ie/pygame.html - cheers, and good luck! (Paul Barry, Dec 2009). ... which eventually led me to this PDF ... which was right after this: "[David has Pygame installed on his Mac OS X laptop - it took him the guts of an evening to get it installed. By that time, his hands were shaking and he had built up a bit of a sweat. But, Pygame was installed and working on Mac OS X]"
I'm not in the mood for shaking hands and sweated brow, so I'll leave you to it.
griswolf
Veteran Poster
1,165 posts since Apr 2010
Reputation Points: 344
Solved Threads: 256
So I want to make sure I do this right:
Step 1: Download pygame-1.9.1release.tar.gz from the PyGame website and save
it to your disk - mine was saved into my Downloads folder. With the download
complete, open up a new Terminal window and type: cd Downloads
Ok thats pretty easy
Step 2: Issue tar zxvf pygame-1.9.1release.tar.gz to unpack the downloaded file.
As in, write that in Terminal and press enter?
Step 3: Change into the newly created directory: cd pygame-1.9.1release
I assume 'cd' is the terminal command for switching directories?
Step 4: Issue this command: python3 config.py
Step 5: Edit the newly-created Setup file changing this line (on my system it was line
72):
pypm src/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)
to look like this (note: addition of # at the start of the line):
# pypm src/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)
Be sure to exit and save the Setup file.
Step 6: From the command-line, issue this command (exactly as shown, all on the
one line):
export CC='/usr/bin/gcc-4.2' CFLAGS='-isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386'
Step 7: Build PyGame with this command: python3 setup.py build
Again, that's in Terminal?
This will take a while and you'll see a lot of stuff on screen (including a bunch of
warnings, which you can safely ignore). You only have to worry if you see the word
“error”.
Step 8: Install PyGame as follows: sudo python3 setup.py instal
The answer is yes for all your questions in red.
Gribouillis
Posting Maven
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691