Python2.4, Python2.5 and Ubuntu 10.04 lucid lynx

Ubuntu lucid lynx does not have Python 2.4 and 2.5 runtimes available in the repositories, so if you are a developer and you are in need of those, then you have two options: One is try to find binaries somewhere else or just compile them from source. In this article, I’m going to point out the steps for compilation.

Go to and download the sources for the version you want. In my case I download Python2.4 Untar the bz2 or gzip file. Go to Python-2.4.4 (my Python version) and cd into Modules. Edit the Setup file and uncomment those modules you need. Amongst them I uncommented the zlib module. You’ll need to install from repos the zlib1g-dev package and the Tcl/Tk one as well. I take for granted you’ve got g++ compiler as well as it is necessary. ./configure, make and sudo make install. Take into account that the python2.4 runtime will be installed in /usr/local/bin/python and /usr/local/bin/python2.4 In my case I deleted the “/usr/local/bin/python” leaving the “/usr/local/bin/python2.4”Β  (both are the same) to avoid clashing with the python (2.6) in /usr/bin as apparently the shell looks first in /usr/local/bin.


About jordilin

I'm a Senior Software Engineer with an MSc in Telecommunications Engineering. I've got a range of interests including Linux, a very powerful and limitless operating system, travelling, gastronomy and technology.
This entry was posted in HOWTOs, Linux, Ubuntu Linux and tagged , , . Bookmark the permalink.

14 Responses to Python2.4, Python2.5 and Ubuntu 10.04 lucid lynx

  1. Manually compiling should indeed work.

    Another popular solution to this in the Plone community (and probably the wider Zope community) is to use a special buildout to compile python:
    This creates binaries for python 2.4, 2.5 and 2.6, I think all with readline support installed.

    Of course you *do* need some python installed first before you can run this buildout… :-/ The system python2.6 that is still available should work fine for that though.

    As far as I know this python buildout was initially created to solve problems with the system python on Mac OS X Show Leopard; that one is apparently not fit for running a zope 2 instance. But it works fine on Linux as well.

    • jordilin says:

      Thanks indeed. Actually, what surprised me is that it was really straightforward taking into account that sometimes compilation requires additional dependencies and packages that could end up in a difficult process.

    • lioujian says:

      $ /usr/bin/python
      Traceback (most recent call last):
      File “” line 113, in
      AttributeError:’NonType’ object has no attribute ‘location’

  2. TJ says:

    Your article helped but this is the lazy way i figured for anyone else landing here.
    add repository “deb karmic main restricted universe multiverse”
    install python2.5 /2.4
    run as “python2.5”

    I am using this for appengine.

  3. jordilin says:

    If you enable the karmik repository in your sources.list when using lucid, then you could end up with a broken system due to version clashes between packages.

  4. There’s a PPA that contains Python 2.4 and 2.5 for lucid. I was hoping to find its name when I stumbled upon this blog page. Oh well, let me ssh into a server that has it enabled and look it up… Here:

    sudo add-apt-repository ppa:fkrull/deadsnakes

  5. It’s a good idea to install zlib1g first which is needed for the setup tools to work. Thanks for the advice on removing /usr/local/bin/python .

  6. Pratama says:

    thanks jordilin,,,

    this is help me..

    i’m newbie on linux…. πŸ™‚

  7. miscnet22 says:

    I came across your blog trying to figure out somethings related to python 2.5 and Ubuntu 10.04.
    FYI – I found another blog that has this same post almost word for word.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s