Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

I am on Ubuntu 11.04 and have Python 2.6 installed. I would like to upgrade to Python 2.7. How should I go about doing this?

share|improve this question
Are you sure you're on 11.04? It ships with Python 2.7 by default. – Stefano Palazzo Jun 5 '11 at 4:41
I don't know. I have upgraded from 10.04 to 11.04, where I had python 2.6. Could that be the reason? – Nanda Jun 5 '11 at 4:51
You can open a Terminal and type lsb_release -cds to make sure. – Stefano Palazzo Jun 5 '11 at 5:03
up vote 2 down vote accepted

If indeed you find you don't have python 2.7 its in the repositories

sudo apt-get install python2.7

You may find, however, that instead of calling python to compile, having multiple versions will need you to specifically call python2.7.

You can overwrite this behavior by redirecting the 'python' link in your /usr/bin/ directory to the python2.7 executable. (This may cause problems if you're keeping legacy programs that are expecting 2.6 and are badly coded, however I very much doubt it.)

share|improve this answer
hi thomas, when i typed python in the command line, it says i have v2.71. That's great, but why does it show v2.6 of IDLE, the Unity menu, when I type idle? Any clues? – Nanda Jun 6 '11 at 17:45
i wouldn't be surprised if you had 2.6 installed as well, lots of GUIs are written in python, and demand certain versions. i would expect, therefore, that IDLE should have a setting allowing you to choose the python executable it uses? redirect this to /usr/bin/python and you should be back on 2.7 :) – thomas michael wallace Jun 6 '11 at 17:53

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.