How to update ubuntu's python with latest version from source? [duplicate]

We apply some patches in Debian/Ubuntu's python, that make it behave a little differently to upstream Python. You can't replace your system python2.7 package with something else, without breaking all other python modules or applying these patches. (I'm particularly thinking of the distutils-install-layout patch).

The easiest answer is: don't.

Next option: Compile it by hand and install it in /usr/local. It won't replace your system python, but you'll be able to use it. This is the best supported way of achieving what you want.

Finally, if this really is something you want to do. Grab the current python2.7 source package, update it to use the new upstream version that you want to use (this will probably require massaging the patches a little). Build. Install. I'm intentionally not going into details here, because it's not going to be that simple :)