apt-get install checkinstallThe instruction how to compile python from source is here. Once you compiled python here is a simple command that does the rest for you:
checkinstall -y --pkgname=python2.7Once it finishes you will get a deb file in the current directory. You can install it this way:
dpkg -i python2.7_2.7.6-1_i386.debHere is how to remove it:
apt-get remove --purge python2.7Note, packages built with checkinstall are not updated by OS package management system, thus updates need to be provided manually.