OK, all of those messages are from when gcc attempts to build various python extensions/libraries. It would seem that it is unable to locate the files mentioned, so perhaps you don't have all of the source. Not sure what to suggest to fix that.
However, I will reiterate that you already have python 2.7 installed. You do not need to build python from source or install it manually. It is already on your machine and available to you and to any other programs that require it!
From looking at the instructions here:
The pre-requisites are Python 2.5 - So the version you already have pre-installed (2.7) should be fine because all of the 2.x series are backwards compatible with each other.
Then the other requirements, mxDateTime and Mako (optional) are available in the Ubuntu repositories:
Running the command apt-cache search --names-only mxdatetime
lists two packages:
python-egenix-mxdatetime - date and time handling routines for Python
python-egenix-mxdatetime-doc - date and time handling routines for Python (documentation)
So to get mxDateTime installed you need to use:sudo apt-get install python-egenix-mxdatetime python-egenix-mxdatetime-doc
And that's your other main dependency sorted!
A search for mako (which is optional) reveals these packages:
python-mako - fast and lightweight templating for the Python platform
python-mako-doc - documentation for the Mako Python library
So if you want those packages you can install them too!
The final optional dependency, psyco doesn't appear to be available. So you will need to download, build and install …