Friday, March 6, 2015

Installation

Before we can begin, we need to install Python and Pygame.  I am running 64-bit Windows 8.1, but I will provide installation instructions for other operating systems. If you are a user of MacOS or Linux and run into any issues with the code or information provided here, please inform me, and I will make corrections.  Later on, I will edit my code so that it works for the versions of Python and Pygame mentioned here, but as I am still learning, I will start with only 3.2.5 for simplicity's sake.

Windows:
In order to install Python, download and run the Windows x86 MSI Installer directly from Python's site.  (Alternatively, you can go to the download page for Python 3.2.5.) I used the x86 installer for simplicity's sake because I could not find a 64 bit stable release installer for Pygame. 3.2.5 was the last binary release of Python, according to the official site, and I discovered first-hand that newer stable releases of Python, unfortunately, will not work with the latest stable release of Pygame. Afterwards, download and run pygame-1.9.2a0.win32-py3.2.msi from the Pygame download page. To test if you have installed Pygame correctly, open the Python command line and enter in "import pygame" (Sweigart, 2012, p. 2)  If nothing happens, Pygame is installed correctly with the correct version of Python.

MacOS:
If you do not already have Python 2.7 installed, you can download the Mac OS X 32-bit i386/PPC installer directly from Python's site. Python 2.7 is the latest version of Python supported by Pygame in MacOS, according to the Pygame download page. After you have Python, download and run pygame-1.9.1release-python.org-32bit-py2.7-macosx10.3.dmg from the Pygame download page. If you decide to use the Apple-supplied Python, the download page has packages specifically for them.

Linux (Debian):
If you want to install Python easily and have apt installed, open a terminal window and type “sudo apt-get install python2.7” and press enter (Sweigart, 2012, p. 2). In order to install Python, you will need the root password. This installation does not include IDLE, so you will have to install that separately by entering in “sudo apt-get install idle.” Finally, to install Pygame, type and enter, “sudo apt-get install python-pygame”.



Sweigart, A. (2012). Making games with Python & Pygame. Retrieved from http://inventwithpython.com/makinggames.pdf

No comments:

Post a Comment