I had python 2.7.3 and ipython 1.2 up and running correctly on my Linux system (ubuntu 12.04) but was trying to install a
PYTHONHOME
Change the location of the standard Python libraries. By default, the libraries are searched in prefix/lib/pythonversion and exec_prefix/lib/pythonversion, where prefix and exec_prefix are installation-dependent directories, both defaulting to /usr/local.
When PYTHONHOME is set to a single directory, its value replaces both prefix and exec_prefix. To specify different values for these, set PYTHONHOME to prefix:exec_prefix.
Try to clean up your PYTHONHOME:
user$ export PYTHONHOME=
As for installing matplotlib, I would recommend the following:
sudo apt-get install python-matplotlib
(details here)