Installing Pygame Zero¶
On Windows¶
Install Pygame for Python 3. This is available as a .msi installer from the Pygame Bitbucket.
Install Pygame Zero with pip:
pip install pgzero
On OSX¶
homebrew is a package manager for OSX. It will allow you to install nearly everything you need to get Pygame Zero up and running.
All commands will be entered in a Terminal window.
Install homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install Python 3:
brew install python3
Install the following dependencies, needed for compiling Pygame:
brew install sdl sdl_image sdl_mixer sdl_sound sdl_ttf
Now pygame can be installed easily using Python’s own package manager, pip3:
pip3 install hg+http://bitbucket.org/pygame/pygame
Finally, install Pygame Zero!
pip3 install pgzero
On Ubuntu Linux¶
There is a .deb package of Pygame for Python 3 available in this PPA.
Add the PPA to your system sources:
sudo add-apt-repository ppa:thopiekar/pygame
Update the package list:
sudo apt-get update
Install the package:
sudo apt-get install python3-pygame
Install Pygame Zero with pip:
pip3 install pgzero
On Debian 8 (Jessie)¶
(There is a .deb package of Pygame for Python 3 in Debian unstable “Sid”. On Jessie it’s relatively simply to compile Pygame yourself.)
Install the dependencies:
sudo apt-get install mercurial python3-dev python3-numpy libav-tools \ libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev \ libsdl1.2-dev libportmidi-dev libswscale-dev libavformat-dev \ libavcodec-dev build-essential
Grab Pygame source:
hg clone https://bitbucket.org/pygame/pygame
Build Pygame:
cd pygame python3 setup.py build
Install Pygame:
sudo python3 setup.py install
Install Pygame Zero with pip:
pip3 install pgzero
On Raspberry Pi¶
pgzero is likely to make an appearance in the Raspbian repo before long; until then...
(Starting from a vanilla noobs-install Raspbian)
- sudo apt-get update
- sudo apt-get install python3-setuptools python3-pip
- sudo pip-3.2 install pgzero