Skip to content

Instantly share code, notes, and snippets.

@brousch
Last active August 19, 2018 14:39
Show Gist options
  • Save brousch/6395214 to your computer and use it in GitHub Desktop.
Save brousch/6395214 to your computer and use it in GitHub Desktop.
A script to install Pygame 1.9.1 into a Python2.7 virtualenv on Ubuntu 12.04. Make sure you have activated the virtualenv before running this script or it will install Pygame system-wide.
#!/bin/sh
BASE_PATH=`pwd`
sudo apt-get build-dep python-pygame
sudo apt-get install python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev libv4l-dev
cd /usr/include/linux
sudo ln -s ../libv4l1-videodev.h videodev.h
cd $BASE_PATH
wget http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz
tar -xzf pygame-1.9.1release.tar.gz
cd pygame-1.9.1release
python config.py
sudo python setup.py install
cd $BASE_PATH
rm pygame-1.9.1release.tar.gz
sudo rm -rf pygame-1.9.1release
@BaldrTheAesir
Copy link

Trying to run this on ubuntu trusty without sudo (it installs into the global dir otherwise...) yields a permission denied error in the end.

you need to add a "sudo python setup.py install_headers" after "python setup.py install" to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment