How can I install Python 2.6 on 12.04?

Solution 1:

I'm using a PPA: https://launchpad.net/~fkrull/+archive/deadsnakes

Install the PPA:

sudo add-apt-repository ppa:fkrull/deadsnakes

Run Update:

sudo apt-get update

Install your flavor:

sudo apt-get install python2.6 python2.6-dev

Solution 2:

Check out pythonbrew. It does a great job of managing multiple python versions and enviroments. It builds each version of python from source, but does so in a user friendly way. After you install it just run:

pythonbrew install 2.6
pythonbrew switch 2.6

Then you can use it with virtualenv to create a virtual enviroment with whatever frameworks and libraries you need without having to worry about conflicts.