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

The default python version on my ubuntu system is 2.7, but 2.6 is still present.

I've installed headers (apt-get install python-dev), since it's needed to compile and install python packages, for current version.

However, some of my projects still run on a 2.6 virtual python environment. For them, I cannot install eggs and packages since, among others, Python.h is missing. Do I need to install an older version of python-dev? How to do so?

share|improve this question
up vote 2 down vote accepted

Try installing python2.6 and python2.6-dev.

share|improve this answer
tnx allot! it was simply a matter of use the correct apt-get commands! – Gabriele B Sep 2 '11 at 10:16

You can use python virtualenv in order to separate the different versions and packages of python you need to run.

This question also deals with a similar problem.

There is also a bash script for installing and switching versions of python on the fly. If I remember the name of it I will edit this post. You can use that as well as Virtualenv to completely change python environments

share|improve this answer

My instinctual response would be you'd need to install python from source, typically this installs to different target locations on the drive so you should be fine. I found a link a that might help you compile from source.

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.