Uninstall python built from source?
You can use checkinstall to remove Python. The idea is:
- Install checkinstall
- Use checkinstall to make a deb of your Python installation
- Use
dpkg -r
to remove the deb.
See this post for more details.
PS. Note that Ubuntu must always have at least one installation of Python installed, or else major pieces of your OS stop working. Above, I'm assuming it's safe to remove the Python built from source, without removing the Python that was installed by the package manager.
PPS. If you accidentally erase all Python installations from your Ubuntu machine, all is not lost. Instructions on how to recover from this situation can be found here.
I did the following and reinstall using 'make install' and it worked.
whereis python3.6
rm -rf /usr/local/lib/python3.6
rm -rf /usr/local/bin/python3.6*
make install