Ok, I recently installed Python27 with macports, but something happened and I created  a mess. So I uninstalled it with sudo port uninstall --follow-dependents python27. Then I reinstalled it, did sudo port select --set python python27. All successful up to this point. But now I go to run python, and I get an error:
ImportError: No module named site
Any ideas? It's been driving me crazy for the past hour. 
Mac OS X Lion / Python 2.7 / MacPorts
I had this problem and in the end it turned out to be to do with permissions.
Stupid mac-ports did something, not quite sure what, but I applied sudo chmod -R a+x $PYTHONPATH (which basically makes all files beneath $PYTHONPATH executable by everyone).
It's a nasty, and perhaps dangerous fix from a security perspective, but at this stage I just want to get it to work!
ImportError: No module named site - Python27 - MacPorts