If you have installed any python versions from source , then also you can face this problem.
So
Follow these instructions and things should work out:
Open a terminal Ctrl+Alt+T(Open Applications menu, Accessories, Terminal). Run sudo nautilus
(no quotes), giving your password when prompted.
Using the file browser that opens, navigate to /usr/local/bin/
Delete the file called python
Go to /usr/bin/
Right-click the file called 'python' and click copy. Paste it into /usr/local/bin/
Go back to '/usr/bin/' and copy 'python2.6' and paste it into /usr/local/bin/
Do the same with the file called python2.6-config
Total credit goes to ubuntuforums.org