I want to clean all traces of python from my Ubuntu. Is there any easy solution?
To start with I guess I should remove all pip packages. I tried command as suggested here, but got bunch of failure messages:
#pip3 freeze | xargs pip3 uninstall -y
Found existing installation: appdirs 1.4.4
Uninstalling appdirs-1.4.4:
Successfully uninstalled appdirs-1.4.4
Found existing installation: attrs 19.3.0
Not uninstalling attrs at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'attrs'. No files were found to uninstall.
Found existing installation: Automat 0.8.0
Not uninstalling automat at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'Automat'. No files were found to uninstall.
...
What should I do? This answer asks to run:
sudo rm -rf /usr/local/lib/python2.7/dist-packages/twitter
Should I run? I have py files at following paths:
usrlibpython2.7
usrlibpython3dist-packages
usrlibpython3.8
Also this unaccepted answer asks to do:
sudo apt remove python-numpy
I am currently on wsl2 Ubuntu. And am wary, because today only, I (possibly) screwed my another Ubuntu installation, by accidentally deleting all above pythonXYZ
folders. Now I am neither able to remove all traces of python nor able to reinstall python on that machine. It keeps giving me some error (may be I have to ask separate question for that). But how do I fix this WSL Ubuntu?