UPDATE: Apparently, this is no longer necessary. As of February, 2017, you can just run pip install pygame and it will install the right version of pygame for your environment. (Thanks, Chek Wei).
I’m not a game developer, but I’ve been playing with Pygame lately and have been impressed. I plan to use it in one of our Python courses to teach object-oriented programming. I use 64-bit Windows 8, so I have the 64-bit version of Python 3.4. Most of our students are unlikely to be game developers, but because games have obvious visible objects, they provide a nice framework for teaching OOP.
Unfortunately, Pygame doesn’t have an official 64-bit installer, so they recommend you use the 32-bit version of Python. So, I installed the 32-bit version of Python alongside the 64-bit version I already had, but that was a pain as I had to constantly make sure I was running the right one. It also made the 32-bit version the default.
Save the file locally. Do not rename the file as the file name structure is important.
Wheel (.whl) files are installed using pip and wheel. So before installing the wheel file, you need to make sure you have an up-to-date version of pip and of wheel. To do this:
Click the Windows icon and select Run:
Type “cmd” in the Run prompt and press OK:
PIP is used to unpack wheel files. At the prompt, type “python -m ensurepip”:
If it tells you the requirement is already satisfied, run the upgrade command: “python –m ensurepip –upgrade”:
Install wheel. At the command prompt, type “pip install wheel”:
If it tells you the requirement is already satisfied, run the upgrade command: “pip install wheel –upgrade”:
Now you’re ready to install pygame 1.9.2a0 cp34 none win_amd64.whl. At the command line, make sure you’re in the same directory as the .whl file and then type “pip install pygame-1.9.2a0-cp34-none-win_amd64.whl”:
If you get an error saying the file name does not exists, it’s likely because you’re running the pip install command from a different directory. Either use navigate to the correct directory (reference) and run the command again or run the command using a full absolute path (e.g., “pip install c:\users\nat\pygame-1.9.2a0-cp34-none-win_amd64.whl”).
Have fun making games with pygame!
Webucator Delivers Instructor-led and Self-paced Training