Here is a quick tutorial on how to get Pygame up and running with Python 3 on a Mac with OS X 10.6.
Rationale
The Pygame download site presently has packages for Python 2.4, 2.5, 2.6 and 2.7 for OS X, but none for Python 3 (3.2 to be precise). This is odd, as everyone is doing Python 3 development these days, don't you think? And there even is an installer for Python 3 on MS Windows. So, let's change that and get Pygame working with Python 3 under OS X.
Prerequisites
Make sure the thing in front of you is an Apple computer with an OS X operation system. I my case it was a MacBook Pro with OS X 10.6.6 'Snow Leopard'.
- Download Pygame for free. Set of Python modules designed for writing video games. Pygame is a Free and Open Source python programming language library for making multimedia applications like games built on top of the excellent SDL library. Like SDL, pygame is highly portable and runs on nearly every platform and operating system.
- Pygame for python free download - Python, Python (32-bit), Python Interpreter, and many more programs.
I recently installed PyGame 1.9.1 on Mac OS X 10.6 (Snow Leopard) running Python 3.1 - (instructions at the bottom of the page. Cheers, and good luck! (Paul Barry, Dec 2009). A method of installing pygame on Mac OS X 10.7 (Lion) Here's how I installed PyGame 1.9.1 on Mac OS X 10.6 (Snow Leopard) for Python 2.7.2. Mountain Lion install.
You will need XCode, the Apple developer toolset. For OS X 10.6 'Snow Leopard', you will find it on the installation DVD under 'Optional Packages' or similar. For OS X 10.7 'Lion' you can download XCode for free in Apple's App Store.
To learn about your computer's operating system version, click the apple symbol in the top left and select the first menu item 'About This Mac'.
Get A Package Manager
Next, get a decent package manager to be able to conveniently install dependencies. I used Homebrew, and so should you. In the Finder, go to Applications -> Utilities and start the Terminal. To install Homebrew, type
and hit Return.
Install Python 3
Homebrew has a recipe for Python 3, which we are going to use. Type
and hit Return. Once that is done, verify the Python version by typing
Install Pygame
The following is taken from a Pygame Issue Tracker thread.
First install the Mercurial version control system:
Then do the same for the git version control system, which is needed by a dependency package:
Now install all the dependencies of Pygame:
Almost there! To install Pygame now, we will use pip. Go and get it by running:
Pygame Download Mac Os X
And now, finally:
After this is done, verify that it is working:
Free Games For Macbook Pro
That's it! Now you have Pygame for Python 3 installed and working and can start hacking.