Another way to install extra Python package is by source.
1. Install the build-essential and gcc.
- sudo apt-get install build-essential gcc
2. Go to your target installation directory (usually i put them in /usr/local), download the source file.
3. Extract the source archive.
- tar -xvzf Python-2.5.6.tgz
- cd Python-2.5.6
4. Build and install.
- ./configure –prefix=/usr/local/python2.5
- make
- make test
- sudo make install
5. In the above steps, you may encounter the missing dependencies error such as
- ImportError: No module named _sqlite3
6. In that case, install the missing dependencies.
- apt-get install libsqlite3-dev
- apt-get install libbz2-dev
7. After the installation is completed, create the symbolic link in /usr/bin for the new Python 2.5.
- sudo ln -s /usr/local/python2.5/bin/python /usr/bin/python2.5
Done =)
Reference:

But python 2.6.5 is installed on Ubuntu by default. GCC too.
LikeLike
Yes. the post is for any Ubuntu user who wants to fall back the python from 2.6 to 2.5.
LikeLike