How to Install Python and Pygame

Python is a very powerful yet simple language. One of its advantages is the availability of many libraries. One special library is the Pygame library that is suited to do computer graphics and make games. This tutorial will guide you step by step installing Python and Pygame.

NOTE: If you don’t have both Python and Pygame, make sure you install Python first.

Installing Python

Windows or Mac

The installation process for Windows and Mac operating systems is pretty easy. Just go to http://python.org/download and download the appropriate setup package for your Operating System. After that, just run the setup package.

Linux/BSD

If you are using a Linux or BSD system, chances are, you already have python installed. To find out open a shell program and enter the command  “python -V”.  If you get something like shown below, then you have python installed.

$ python -V
Python 2.7.1

However, if you get an error message, then, you don’t have python installed. You can install it in one of these 3 ways:

  • Install using your operating system package management  system (like apt-get on Ubuntu, yum on Fedora, pkg_add in FreeBSD, etc).
  • Install by source. This is recommended for advanced users. You can find the source on http://python.org/download.
  • Search for a ready built package doing a web search for Python +  [Your operating system].

Other platforms

For other platforms, first try with the package management system (well, if it does exist). If unsuccessful, try doing a web search for a ready built package, doing a web search for Python +  [Your operating system].

Installing Pygame

First, make sure you have python installed. After that, go to http://pygame.org/download.shtml. There, you will find download links ordered by operating system and python version. Pick the appropriate link to your operating system and make sure to install the correct version for your python version. For example, if you were using Windows and Python 2.6 you would follow the link for pygame-1.9.1.win32-py2.6.msi. Finally, after downloading the package, install it, and you are done.

Conclusion

To install python and pygame, we must install python first. On Windows or Mac systems,we just go to http://python.org/download, download the package and install it. For Linux or BSD, it is highly probable that python is already installed. If not, we install it using the operating system’s package management system. To install pygame, we go to http://pygame.org/download.shtml and download the appropriate package for our operating system and python version.

  1. Good replies in return of this matter with solid arguments and describing
    everything on the topic of that.

Leave a Comment

Notify me of followup comments via e-mail. You can also subscribe without commenting.