CompileRedHat — wiki
Although pygame should installed from your package manager in most cases, there are few that require compiling from source. To compile from source in Red Hat/Fedora/CentOS you should follow the commands below.
# As root install the following packages yum install python-devel SDL_image-devel SDL_mixer-devel SDL_ttf-devel SDL-devel smpeg-devel numpy subversion portmidi-devel # It will also install the libraries (of devel packages) as dependancies.
smpeg-devel is at rpmfusion-free repository for fedora/red hat/CentOS. You can read here: how to add that repository.
When all the packages are installed you're ready to download source and compile pygame. You can do that through svn (for the most latest version) with the command below:
# As user do the following hg clone https://bitbucket.org/pygame/pygame cd pygame
Or you can simple download the latest version from pygame site:
# As user do the following wget http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz tar xvf pygame-1.9.1release.tar.gz cd pygame-1.9.1release
# Once you're in pygames source folder simply run the following command: python setup.py build
# pygame just compiled from source # To install it on your system, do the following as root: python setup.py install