Ubuntu 8.04 comes with Python 2.5 and no 2.6 package support in the apt-get ecosystem. Searching around I found http://www.saltycrane.com/blog/2008/10/installing-python-26-source-ubuntu-hardy/ and all went well except I got a few more missing modules than the article reports;

Failed to find the necessary bits to build these modules:
_bsddb             bsddb185           dbm             
dl                 imageop            sunaudiodev     
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

Im pretty sure i want/need dl. I know it's deprecated starting with 2.6, but it should still be there.

Overall Im finding it very difficult to get 2.6 installed. I would ideally like to replace it (point /usr/bin/python at 2.6) but looking in 2.5 site-packages and seeing symlinks to a 'pyshared' directory, etc. makes me fear that things will break terribly.

I also tried to setup a virtualenv on another, 2.6 capable machine and copied over the virtualenv but it cannot execute the python binary.... idunno.

Im really just trying to get 2.6 installed to run a Django project. Nothing more, so it doesn't have to replace the system python but if it can work, it'd be nice.

migrated from stackoverflow.com Mar 31 '11 at 4:47

This question came from our site for professional and enthusiast programmers.

  • Actually, unless it goes by a different name, i cannot import dl or dlopen under 2.5 either. So maybe im ok? – Flowpoke Mar 30 '11 at 18:23

This was solved by simply downloading the 2.6 release from python.org and installing it along side 2.5 (/usr/lib/python2.6/) and symlinking /usr/bin/python to python2.6. A few modules were reported missing during the build process but ignoring them didn't seem to break anything (that i needed, anyway).


This doesn't exactly answer your question but there appears to be a backport of Python 2.6 in this PPA:

Though it has not been updated in quite some time but might get you what you need with less hassle.

  • Ahh. Very helpful. I ended up rolling my own, alongside 2.5. I unlinked /usr/bin/python and pointed it to 2.6, etc. and things seems to work alright. shrug I luckily don't rely on it too much outside of what im directly trying to setup. – Flowpoke Apr 5 '11 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.