How to install python 2.5.4?

I have installed Ubuntu 12.10 on my laptop, now i want to use Python 2.5.4 for educational purpose. Can any one help me with step by step instructions... I also need IDLE for 2.5.4.


Solution 1:

I use https://launchpad.net/~fkrull/+archive/deadsnakes for all the old python versions.

It seems maintained and new versions are also added.

simply do the following:

sudo apt-add-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install python2.5

Solution 2:

This will install 2.5.4 from source:

sudo apt-get install build-essential gcc
cd Downloads
wget https://www.python.org/ftp/python/2.5.4/Python-2.5.4.tgz
tar -xvzf Python-2.5.4.tgz
cd Python-2.5.4
./configure --prefix=/usr/local/python2.5
make
make test
sudo checkinstall --pkgname python2.5 --provides python2.5 

NOTE: if compiling was halted with error from Modules/getbuildinfo.o and Modules/getbuildinfo.c ---> redo the configure command like this SVNVERSION=not-found ./configure --prefix=[your/path/preference]

If you want to replace your standard python:

sudo ln -s /usr/local/python2.5/bin/python /usr/bin/python2.5 </pre>

You can use this version by issuing python2.5 instead of python.