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+

If pip isn’t working to install PyGame

hg clone

cd pygame

python install

Pygame Install reference

Leave a Comment