Appendix A. Installing Python and Pygame

This appendix shows step by step how to install Python and Pygame with figures detailing each step. Python and Pygame are both very easy to install, and equally easy to use, but someone who is not familiar with these tools may not know where to start. This appendix explains the steps.

Installing Python

The website for Python is http://www.python.org. This book uses Python 3.2. If you have an earlier version already installed, like 2.7, the code in this book will not compile with that earlier 2.x version. The Python language changed with 3.0. If you have a later version after 3.2, then the code in this book should compile, but I can’t guarantee it (obviously because that’s in the future). Python is pretty easy to install, so I recommend installing 3.2 if you have the option of which version to install.

The download page for Python 3.2.1 is found at http://www.python.org/download/releases/3.2.1/.

If you are using Windows, you will want to download the “Windows x86” version. If you know for sure that you have 64-bit Windows, then download the “Windows x86-64” version. Likewise, if you have a Mac, download either the 32-bit or 64-bit version of the Python installer for Mac, depending on which version of OS X you have.

For easy reference, the following steps will go through the steps for installing Python (for beginners). Advanced readers may skip this section. First, when running the installer, we are presented with the first screen shown in Figure A-1.

The first screen that comes up with the Python 3.2 installer.

Figure A.1. The first screen that comes up with the Python 3.2 installer.

The next screen, shown in Figure A.2, allows you to change the default installation folder. I recommend leaving it at the default location, for the benefit of file associations, but you may change it if you need to.

Selecting the installation folder.

Figure A.2. Selecting the installation folder.

Next up is the installation options screen shown in Figure A.3. I recommend just leaving these options at their default values, unless you have a reason to change them.

Installation options.

Figure A.3. Installation options.

Next, we are presented with the final screen before installation begins, shown in Figure A.4. Upon clicking the Finish button, the installer will install the files into the location you specified.

Preparing to begin the installation.

Figure A.4. Preparing to begin the installation.

Finally, we see that the installation begins, as shown in Figure A.5. This will simply show the progress as the Python files are installed on your computer.

Installation of the Python files.

Figure A.5. Installation of the Python files.

Installing Pygame

Pygame must be installed after Python, because it is an add-on library. Pygame does not automatically get installed with Python. Despite the name, Pygame was not created by the same developers that created Python itself. So, we must download and install Pygame separately. This must be done after Python has already been installed.

There may be a new version of Pygame by the time you read this, but I strongly recommend installing version 1.9, since that is the version covered in this book. If a new 2.x has been released, you may have problems compiling the code with a newer version of Pygame. There’s nothing wrong with 1.9. New versions of libraries like Pygame are released with new features, not necessarily to fix problems. So, go ahead and download Pygame 1.9.

The website for Pygame is found at http://www.pygame.org.

The latest installer for Pygame 1.9 that supports Python 3.2 is a file called pygame-1.9.2.a0.win32-py3.2.msi. Note that new files will likely be added to the list of installers in the future, but this is the version you want to use for Python 3.2.

There is an alternate site of installers for Pygame and many other Python libraries at this site: http://www.lfd.uci.edu/~gohlke/pythonlibs/. You can scroll down this comprehensive list to find Pygame.

When you run the Pygame installer, it will automatically detect the Python installation folder and will install itself into that location. There are really no options that you will need to change.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.242.235