-
-
Notifications
You must be signed in to change notification settings - Fork 230
Compiling on Linux
Ankith edited this page Feb 10, 2026
·
6 revisions
sudo apt-get update
sudo apt-get install build-essential git
sudo apt-get install libfreetype6-dev libportmidi-dev python3-dev python3-numpy
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev sudo dnf check-update
sudo dnf install pkg-config gcc git
sudo dnf install freetype-devel portmidi-devel python3-devel python3-numpy
sudo dnf install SDL2-devel SDL2_image-devel SDL2_mixer-devel SDL2_ttf-develif your system has yum instead of dnf you may try replacing that in the above commands, it will probably work in the same way (but is untested by us)
sudo pacman -Syyu
sudo pacman -S pkg-config base-devel git
sudo pacman -S sdl2 sdl2_ttf sdl2_image sdl2_mixer portmidi
python3 -m pip install numpyThe below commands need to be run as super user.
apk update
apk add pkgconf musl-dev gcc git
apk add freetype-dev portmidi-dev py3-pip python3-dev
apk add sdl2-dev sdl2_image-dev sdl2_mixer-dev sdl2_ttf-dev
python3 -m pip install numpygit clone https://github.com/pygame-community/pygame-ce.git
cd pygame-cepython3 -m pip install .Note some distros will not allow you to use pip to install python packages, in that case you will have to run the above command in a python venv.
You may also check out the Advanced compilation guide (for developers) if you are getting into development or are running into issues.