How to install pygame from source onto Ubuntu/Kubuntu

There are two solution to this problem, one using apt-get and one using a manual installation.

Apt-get installation

Ubuntu has a pre-built version of pygame available to you. The actual pygame version is dependent on the Ubuntu version you're running:

Hoary includes pygame 1.6
Run "sudo apt-get install python2.3-pygame". (someone should confirm this is the correct version)
Dapper includes pygame 1.7.1
Run "sudo apt-get install python2.4-pygame".
Hardy includes pygame 1.7.1
Run "sudo apt-get install python-pygame".

Manual installation

There are all kinds of problems when you run "python setup.py install" and this is what I did to fix that:

link to ubuntuforums where the drama played out: here

All should proceed just fine. I can't give you a total solution because of the round-about way that I got it working, but that's the gist of it.

I include here the information about making a deb file that I got on the forum:

Bear in mind the packages I listed above must still be installed for this to work.

I would recommend you download the source package from Debian and rebuild that for Kubuntu.
Going through that process will ensure that you have the right build-deps, and will ensure that the final package is consistent with Debian's python conventions.

The main steps involved are:

There will probably be a couple of false starts as the build process identifies build-dependencies which you don't have. You can shortcut this by reading the .dsc file. If all goes well you will end up with the deb files you need to install pygame onto your system.

Thanks toojays.