Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Situation: Jaunty ships with 2.6, which does not fit my needs because many libraries are still failing. I want to have a system default 2.5. Also, for testing purposes, I need 2.6, 2.5 and 2.4 installed.

Current solution:
I compiled 2.5 and 2.4 from source, and symlinked 2.5 to /usr/bin/python. I also edited some magic file that Ubuntu uses to specify Python version (don't remember now where it sits).

First problem I'm having is that sometimes aptitude installs libraries for 2.6. In most cases, that's avoidable with suffixing -25.

But that's not always the solution, eg. Vim is compiled with 2.6, which does not have access to 2.5 libraries. There is no way to install Vim with python 2.5

Another problem I had recenty is that I installed bypthon. It was failing when using "curses" module, because it was from 2.6 library. I have no idea why/how this happens.

Anyone care to elaborate how to do proper switching of default python in Jaunty?

share|improve this question
up vote 1 down vote accepted

You should be able to install 2.4, 2.5, 2.6 and/or 3.0 from the repositories using Synaptic Package Manager or apt-get or aptitude then use update-alternatives to set up a default. See my answer here for information on using update-alternatives (the answer is even specific to Python).

share|improve this answer
which still lets "aptitude install python-package" do it's work for 2.6 even if I have 2.5 installed. But at least I'm pretty sure now that Ubuntu is Python unfriendly;) – iElectric Sep 20 '09 at 16:53
Note that this breaks upgrading to 9.10! – iElectric Nov 4 '09 at 19:40

Installing multiple versions of Python on Ubuntu from Source

share|improve this answer
This is first google hit and also just the way I have my current Python layout. Still, those two bugs are not avoidable with this solution. – iElectric Aug 25 '09 at 8:36

I know a number of people also use 'virtualenv' to create sub-environments with different versions and libraries.

Check it here: virtualenv

share|improve this answer
In order to use virtualenv with different versions, you need binaries. I'm using virtualenv almost anywhere, just for pygtk development I need system python. – iElectric Aug 24 '09 at 18:37
thanks for the clarification, haven't used it myself, stuck doing .NET all day :( – Keck Aug 24 '09 at 22:11

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.