Saturday, May 22, 2010

Howto: Install Python 2.5.5 on Ubuntu 10.04 Lucid Lynx

So, you're a Python developer and like to use the 2.5.x track instead of the 2.6.x or the 3.x track. Well, never fear! Despite the fact that 2.5.5 is not installed in 10.04, or available in the repositories, you can still install it into your system. The following steps will show you how.

Open your terminal and type the following commands line by line:

sudo apt-get install build-essential gcc
cd Downloads
wget http://www.python.org/ftp/python/2.5.6/Python-2.5.6.tgz
tar -xvzf Python-2.5.6.tgz
cd Python-2.5.6
./configure --prefix=/usr/local/python2.5
make
make test
sudo make install
sudo ln -s /usr/local/python2.5/bin/python /usr/bin/python2.5 

There you have it! Python 2.5.5 is installed. Now if you want to run it, you can either type python2.5 from the terminal, or you can make a shortcut for it by doing the following:

  1. Right-click on Applications.
  2. Select Edit Menus.
  3. Click Programming
  4. Click New Item
  5. Type "Python (v2.5)" in the Name Box
  6. Type "python2.5" in the Command Box
  7. Type any comments (optional) in the comments box or just click Ok

Now it should show up in your programming menu. Have fun with Python 2.5.5!

12 comments:

Ελευθέριος said...

instead of sudo make install is sometimes better to do sudo checkinstall

Ελευθέριος said...

It's best to replace the command
sudo make install

with

sudo checkinstall --pkgname python2.5 --provides python2.5

Perry said...

Thanks,
I've been running in circles trying to get Google app engine to work. It requires 2.5.
Hopefully this install helps.

(and hopefully it doesn't interfere with 2.6, which I understand can be a risk)
Perry

bally said...

This was real helpful!

Aditya Tiwari said...

http://mahageek.blogspot.com/2010/10/installing-python25-for-google-app.html

this is pre-compiled both 64 bit & 32 bit from debian for Ubuntu

Dave said...

Justin,
Your instructions worked beautifully. Very clearly written as well. I needed 2.5 to test web2py on my local machine, and now I have it.

Thanks from Atlanta
Dave

William Stenross said...

Thank you for the directions!

Seeing as Google App Engine still requires Python 2.5 and Ubuntu still ships with 2.6, and this is the first link when you search for installing python 2.5 on ubuntu, I've updated the directions with the most recent version of python 2.5

sudo apt-get install build-essential gcc
cd Downloads
wget http://www.python.org/ftp/python/2.5.5/Python-2.5.6.tgz
tar -xvzf Python-2.5.6.tgz
cd Python-2.5.6
./configure --prefix=/usr/local/python2.5
make
make test
sudo make install
sudo ln -s /usr/local/python2.5/bin/python /usr/bin/python2.5

Justin said...

Thanks for the update info. I'll change the instructions ASAP.

Sam said...

The wget link is broken, should be:

wget http://www.python.org/ftp/python/2.5.6/Python-2.5.6.tgz

Edwin said...

This is a great post and helped on my installation of Python 3.2.2 on Ubuntu 11.04 (Natty Narwhal). Quick side note, though: for successful symbolic linking on the last step, the command needs to be changed to

sudo ln -s /usr/local/python3.2/bin/python3.2 /usr/bin/python3.2

niceguydave said...

Helped me a lot - thanks!

niceguydave said...

Helped me a lot - thank you!