Skip to content

Compiling on Linux

Andrew Hong edited this page Mar 3, 2023 · 4 revisions

Debian-based distros (like Ubuntu and Raspberry Pi OS)

  1. Install the dependencies:
sudo apt-get update
sudo apt-get install build-essential git
sudo apt-get install libfreetype6-dev libportmidi-dev libjpeg-dev python3-setuptools python3-dev python3-numpy
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev 
  1. Clone the repository in a directory you are happy to work in:
git clone https://github.com/pygame-community/pygame-ce.git
  1. Change into the pygame subdirectory you just created, and build pygame Community Edition:
cd pygame-ce
python3 -m buildconfig
python3 -m pip install . --user
  1. That's it!

Arch-based distros (like Manjaro)

  1. Install the dependencies:
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 numpy setuptools
  1. Clone the repository in a directory you are happy to work in:
git clone https://github.com/pygame-community/pygame-ce.git
  1. Change into the pygame subdirectory you just created, and build pygame Community Edition:
cd pygame-ce
python3 -m buildconfig
python3 -m pip install . --user
  1. That's it!