Python PyGame installation

Most packages are available from pip as precompiled .whl. PyGame is quick and trivial to install on most devices, and PyGame allows playing sound from Numpy arrays.

pip install pygame

pip prefers .whl binaries over compiling.

Source compile pip (optional)

Force PyGame manual source compilation:

apt install mercurial ffmpeg libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libfreetype6-dev libavformat-dev libportmidi-dev libswscale-dev

pip install hg+http://bitbucket.org/pygame/pygame

If pip isn’t working to install PyGame

hg clone http://bitbucket.org/pygame/pygame

cd pygame

python setup.py install

Pygame Install reference

Leave a Comment