Python PyGame installation

less than 1 minute read

PyGame is trivial to install on most devices. PyGame allows playing sound from Numpy arrays.

python -m 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

python -m pip install hg+https://bitbucket.org/pygame/pygame

Manual build

This is rarely needed.

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

cd pygame

python -m pip install -e .

Notes

Leave a Comment