Tuesday, May 21, 2019

Python and Pygame on Nano PI


NanoPI is an Arm based single based computer that can run Debian Linux, Ubuntu Core and Android. It is based on the same design as the Raspberry PI but is more powerful. In this post I'm installing Pygame with Python to run some graphics apps and games for testing. 

For Python
Step 1: Install Python Dependencies:
  • sudo apt-get build-dep python-pygame
Step 2: Install Python:
  • sudo apt-get install python-pygame
Installing Pygame Zero
  • pip install pgzero


For Python3
Step 1: Install Python3 Dependencies
  • $ sudo apt-get install python3-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev
Step 2: Install Python3 
  • python3 -m pip install -U pygame
Installing Pygame Zero
  • pip3 install pgzero
Running an example from the Wireframe Magazine Issue 13
  • Download stars.py from github.com/Wireframe-Magazine/Wireframe-13
  • type pgzrun stars.py