Python + PyGame Install

The following are instructions for a Windows Computer to:

  1. Install Python
  2. Install PyGame
  3. Run a PyGame Example

Note: After should see the following space game

aliens_game

Note also that for Linux the following website has instructions

Install Python

  • Download Python 3.4.2 from https://www.python.org/downloads/
    PythonDownload
  • Run the installer(python-3.4.2.msi) and follow the on screen instructions
  • Press Run Button on the “Open File – Security Question” Dialog for “Do you want to run this file?” question
    pythonsecurityquestion3
  • Press Next button on the “Python 3.4.2 Setup” Dialog for “Select whether …” question
    PythonSetup_001
  • Press Next button on the “Python 3.4.2 Setup” Dialog for “Select Destination Directory” question
    PythonSetup_002
  • Press Next button on the “Python 3.4.2 Setup” Dialog for “Customize Python 3.4.2” question
    PythonSetup_003
  • Press Yes for “User Account Control” Dialog
  • Press Finished button on the “Python 3.4.2 Setup” Dialog for “Complete the Python 3.4.2 Installer” question
    PythonSetup_004

Install PyGame

  • Download PyGame from pygame-1.9.2a0-cp34-none-win32.whl (Now on a Dropbox as link keeps breaking)
  • Copy the file pygame-1.9.2a0-cp34-none-win32.whl to the directory C:\python3.4\Scripts
  • Open a Command Window in the directory C:\python3.4\Scripts
  • In windows Explorer Press Shift Key and the Right button on the mouse
  • Select “Open command window here”
    CommandWindow
  • In the Command Window type “pip3 install pygame-1.9.2a0-cp34-none-win32.whl”
    pygame_install

Run a PyGame Example

  • Using the Windows Start Button, Select “All Programs” and Find the IDLE Python GUI
    StartIDLE_001
  • Double click “IDLE (Python 3.4 GUI – 32 bit)”,  the following screen will appear
    IDLE_PYTHON_CONSOLE
  •  Type in the following command, to check that PyGame is correctly installed:
import pygame
  • Type in the following commands to run an example game, to check that PyGame is working
import pygame.examples.aliens as game
game.main()

IDLE_RUN_PYGAME


41 responses to “Python + PyGame Install

Leave a reply to Anonymous Cancel reply

damian mooney

bits and bytes