Head First Programming - Pygame

Learning programming concepts with Head First

Main menu: Home | Resources | Pygame | Links

Here's the skinny on getting Pygame up-and-running...

We'll keep these instructions as up-to-date as we can as and when Pygame is upgraded. What's here relates to Pygame 1.9.1 (which is the version we used with the book).

Windows Platforms

You are in luck! The Pygame website has a downloadable installer for Windows that works with Python 3. Simply download, double-click to install and you're golden. It could not be any easier - just be sure to download the latest Pygame for Python 3.

Linux Platforms

You are lucky to be using Linux, but it'll take a little bit of work to get Pygame installed and running. But, hey, you're a Linux user - you are used to this stuff. Download the source for Pygame and follow the instructions for getting it built and installed. Pay particular attention to any libraries that are required by Pygame (it does a good job of alerting you when things are missing) and install the libraries BEFORE installing Pygame. Like with Windows, download the latest Pygame (in source code form) that works with Python 3. [Paul has Pygame working on his Linux computer - it took him about 20 minutes to get it going].

Apple Computer's Mac OS X

Ah, lucky you, with your nice Mac OS X computer. Very stylish. Very sleek. Very cool. Unfortunately, Pygame takes a little bit of work to get going and, like with Linux, you need to download, compile and install the latest source code version of Pygame and follow the build instructions. [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]. Paul has created a document (as a PDF) which describes what he had to do to get PyGame to run on Mac OS X 10.6.

[February 2010 Update for Users of Mac OS X ] We are hearing increasing reports of readers using Mac OS X experiencing frustrations at getting PyGame 1.9.1 installed on Python 3.1. When we wrote the book, we made the (now incorrect) assumption that the PyGame Project would release a Mac OS X installer for Python 3 in time for publication (seeing as their last update was in August 2009). This hasn't happened, unfortunately. There may be a number of reasons for this, not least of which may be that the PyGame folk are busy working on a complete rewrite of their technology called "PyGame Reloaded" and that this is obviously their priority. As with all of these projects, we have to be patient as PyGame is a labor of love for these folks and a volunteer effort. Of course, it is annoying to all Mac OS X users to see this work fine on Windows (and Linux), and - of course - it works a treat on Python 2 (which the book's Tkinter code is incompatible with ... sigh). There is some additional information here which may be helpful to some people. Please don't give up on this ... on the bright side, we are amazed at the number of you running Mac OS X, which is cool.