How to install Pygame for Python 3.4 on Ubuntu 14.04(转)

时间:2024-09-11 13:06:38
First run this to install dependencies:

sudo apt-get install mercurial python3-dev python3-numpy \
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 libfreetype6-dev Then download the source for pygame: First install mercurial if you dont have it installed: sudo apt-get install mercurial then: hg clone https://bitbucket.org/pygame/pygame Now build and install pygame for Python 3.4:
cd pygame
python3 setup.py build
sudo python3 setup.py install

Additional comments:
The only version of Python3 I had installed was 3.4 if you have other versions
you might have to be more specific.