Pygame_how to install pygame to Python 3 on Ubuntu

Source: Internet
Author: User
Tags mercurial

Installation

Start by installing all necessary dependencies, and mercurial and checkinstall for the installation:

1 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 libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev checkinstall mercurial

Then download the latest version of
Pygame source code with the following command (this uses mercurial ):

1 hg clone

https://bitbucket.org/pygame/pygame

Go into the downloaded pygame directory:

1 cd pygame

Compile the source code by typing this command into the terminal:

1 python3 setup.py build

Finally install pygame by doing this:

1 sudo checkinstall python3 setup.py install

Extra stuff

Click here to read why you shoshould use checkinstall.

Use this command to see information about your pygame installation:

1 apt-get cache show pygame

And this command to uninstall pygame:

1 dpkg -r pygame

Or:

1 sudo apt-get remove pygame

Notes

The most recent stable pygame version when writing this is 1.9.1 (August 2009). I did this installation on Ubuntu 12.04 and this was needed since there isn't a python3-pygame available in the repository.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.