Okay, so I've completely given up.
I've tried about a thousand different walkthroughs to solve my problem, on every website I can find, but I either get stuck and no one knows the answer, or they just don't work.
So has anyone got an answer to installing PyGame onto Mountain Lion that they know 100% works and they can walk me through it as if I'm 6 years old?
I just want to run PyGame and this is driving me insane.
Cheers.
Pygame is a set of Python modules used for writing simple video games and graphical programs. It is cross-platform, which means it can be installed on both Windows and Mac computers.
For Linux, open a terminal and run " sudo apt-get install python-pygame ". If nothing appears after you hit the Enter key, then you know Pygame has successfully been installed. If the error ImportError: No module named pygame appears, then try to install Pygame again (and make sure you typed import pygame correctly).
Truly portable. Supports Linux (pygame comes with most main stream linux distributions), Windows (95, 98, ME, 2000, XP, Vista, 64-bit Windows, etc), Windows CE, BeOS, MacOS, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX.
Ok, I'm running OSX 10.8.3 (Python 2.7.3), and I got pygame (1.9.1) up and running in about 15 minutes.
Here's what I did. I brewed my Python a long time ago, so I forget the steps there. I seem to remember editing some symbolic links in \usr\local
. At any rate, I'll assume you can use google as well as I can to figure out what to do here.
brew install python27
if you don't have itpip install numpy
if you don't have it.brew install sdl
brew install sdl_gfx sdl_image sdl_mixer sdl_ttf
sudo tar -xvf pygame-1.9.1.tar.gz
sudo python config.py
should fail with a hint to edit Setup
sudo emacs Setup
, or your favorite text editor.SDL = -I/usr/local/include/SDL -L/usr/local/lib -lSDL
, FONT = -lSDL_ttf
, IMAGE = -lSDL_image
, and MIXER = -lSDL_mixer
, respectively.cd src
, emacs scale_mmx64.c
. Look for all occurrences of movsxl
with movslq
. You should find two occurrences.cd ..
and sudo python setup.py install
I only checked that I can load pygame from the prompt in Python, I didn't check anything else.
Refs:
http://jalada.co.uk/2011/06/17/installing-pygame-on-os-x-with-a-homebrew-python-2-7-install.html Error when Installing Pygame on Mountain Lion
If you have MacPorts installed, you can run sudo port install pyXX-game
where XX is your macports python version from 24 to 27 and 31 to 32. This way it'll take care of all your dependencies automagically, and should theoretically work out of the box, assuming your system is set up to use macports python by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With