After installing Python (see ), you’ll want to install Pygame to run the animations and games in through . This appendix will get you up and running. If you’re installing Pygame on a computer at school or work, you may need help or permission from the IT department to perform the installation. If you run into issues, ask IT for help.
For Windows, we’ll use Pygame 1.9.2 for Python 3.2 (see for help setting up Python 3.2.5).
IDLE
).import pygame
and press ENTER. The Python shell should respond with >>>
, as shown in . If it does, then you know Pygame installed correctly and is ready to use.Installing Pygame on a Mac is more complicated than on a PC. You have three options:
Newer Macs come with a version of Python 2.7 preinstalled by Apple as part of OS X. But the version of Python that Apple provides may not work with the Pygame installer. I recommend installing the latest version of Python 2.7 from before you try to install Pygame.
import pygame
. IDLE should respond with >>>
, as shown in .On newer Macs with Retina displays, using Pygame with Python 2.7 looks a bit different than it does on other computers because Retina displays use a higher screen resolution. Your programs should work fine, but they will appear in a smaller area of the screen.
Similar to installing Pygame on a Mac, you have two options for Pygame on Linux:
Most Linux operating systems come with Python installed already, usually Python 2. The game-based and graphical apps in through can run just fine on this older version of Python. The following steps will get Pygame up and running on your Linux system.
python2
in the terminal window. Then test your Pygame installation by entering import pygame
at the >>>
prompt as shown in . Python should reply with >>>
to let you know that Pygame was successfully imported.