Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

There is a package (python-pygame) for Python2 available from the universe repository. However, I want to work through the tutorial in the Invent with Python book. Going through SPM (Synaptic), I cannot find a pygame resource for Python3.

Also, I looked on the Pygame website and it is not clear if Pygame is available for Python3 (though the book indicates that it is).

Can someone help me with my dilemma?

share|improve this question
IMPORTANT_MOVED.txt seems... important. So I changed the svn... line to hg clone https://bitbucket.org/pygame/pygame –  Oleh Prypin Jan 26 '12 at 22:30
Try this answer on Stack Overflow. It worked perfectly for me (minus the part where I forgot to copy and paste the apt-get command with the dependencies and had to hunt down and install them by hand). –  InkBlend Oct 28 '13 at 5:08

2 Answers 2

From Pygame wiki:

Does Pygame work with Python 3?

Only the scrap, _movie, surfarray for Numeric, and threads modules have not been ported. The Pygame alternative, pgreloaded (Pygame Reloaded), also supports Python 3.

The installation packages, however, are incompatible with Python 3.x, so you will have to copy - paste files from 2.x to 3.x .

I would suggest you to get the source packages from the pygame website and install it locally into a virtualenv or buildout. Globally installing python modules in evil anyway :)

share|improve this answer
Thanks for the suggestion! I have posted the steps in the original question for an explicit answer. –  TheGeeko61 Jan 23 '12 at 1:27
@TheGeeko61: I think you should post that as an answer, it's not "bad" in any way. –  Oleh Prypin Jan 26 '12 at 22:27
Alright, I'm doing so... –  TheGeeko61 Jan 27 '12 at 23:12
up vote 4 down vote accepted

Thanks to Sergey's suggestion, this is how to get it working:
(1) Move to a directory where you want the source code to be downloaded to
(2) svn co svn://seul.org/svn/pygame/trunk pygame
    NOTE:  Be sure to use the svn method.  Simply downloading the pygame*.tar.gz
           file from the pygame downloads page didn't work!
(3) cd pygame
(4) python3 config.py
    NOTE:  This confirms that you have the dependencies.
(5) python3 setup.py build
(6) sudo python3 setup.py install
    NOTE:  On my machine, I have the distro's python3.2 installed (which is in
           the /usr/lib directory).  This step places the pygame module into
           /usr/local/lib -- which is what you want (per Sergey's suggestion).

(1) python3
(2) At the '>>>' prompt, type "import pygame"
    VALIDATION:  If you get another '>>>' prompt, all is well.

per BlaXpirit, you may also choose to use hg instead of svn:

hg clone https://bitbucket.org/pygame/pygame

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.