Pygame requires the installation of Python 3, if you don't have it, you can download it at python.org.
Most operating systems may need to use PIP (python package installer that comes installed).
*Note: Installations of Python 3.4 and below do not pre-install PIP.
py -m pip install -U pygame --user
python3 -m pip install -U pygame --user
If you are using anaconda on mac, you may use :
pythonw -m pip install pygame
Pygame should already be installed in raspbian distributions.
Debian/Ubuntu/Mint :
sudo apt-get install python3-pygame
Fedora/Red Hat :
sudo yum install python3-pygame
OpenSUSE :
sudo zypper install python3-pygame
Arch/Manjaro:
sudo pamac install python-pygame
More info can be found at the pygame wiki.
*Note: Some systems may require a system restart.
Most operating systems will run the file with python ./dragracing.py
.
If not you can use python3 ./dragracing.py