You can not use
apt-get to uninstall python since you did not use it or any pre-built package to install python. It just simply doesn't know about this installation so it can not undo the installation.
(It came out later in the comments that the user has already tried to do this.)
There is a popular post about this on [StackOverflow]:https://stackoverflow.com/questions/1550226/python-setup-py-uninstall.
Copied from the site:
You need to remove all files manually, and also undo any other stuff that installation did manually.
If you don't know the list of all files, you can reinstall it with the
--record option, and take a look at the list this produces.
To record list of installed files, you can use:
python setup.py install --record files.txt
Once you want to uninstall you can use xargs to do the removal:
cat files.txt | xargs rm -rf
The reason why you are getting the python from
/usr/local/bin/ and not from
/usr/bin/ is that the first folder comes before the second in your $PATH variable. So the system finds the manually installed version of python first. We can clean this part of the system easily.
If you are sure that there should only be the original python installed on your system then do the following:
sudo rm python python-config python2 python2-config python2.7 python2.7-config
Side note: The general idea of not using
* here is to avoid people accidentally deleting files from their main python installation.
Since you have run several uninstallation methods it would be tricky to be a 100% sure that you managed to remove everything but this way you would be be able to use the default python.