Since on ubuntu 12.04 python 2.5 isn't in the official package sources anymore I'll assume that you downloaded and compiled python yourself.
That means that it probably has been installed to /usr/local
, with the binary in /usr/local/bin
(if you didn't specify any other installation path).
In the PATH /usr/local/bin
usually comes before /usr/bin
, where your system's python (2.7) should be found by default, so therefore this is hidden by the older version.
If you want to keep python 2.5, you should probably rename the binary from /usr/local/bin/python
to /usr/local/bin/python2.5
(or similar), so that you can still call it by that name, but it won't shadow your system python's binary anymore.