2

Python packages should not normally be installed with sudo pip, nor sudo pip3[1], but in the past I think I installed some with sudo, before I knew better.

What's the best way to now recover from this mistake?

Can I somehow find and uninstall these sudo installed packages, or is there a way to start all over?

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
Elliptical view
  • 3,338
  • 1
  • 31
  • 28
  • https://stackoverflow.com/search?q=%5Bpip%5D+remove+all+packages – phd Jan 11 '21 at 08:26
  • `sudo pip freeze | xargs sudo pip uninstall -y` – phd Jan 11 '21 at 08:27
  • The suggested "already answered here" Q/A does not mention sudo, so how can it be an answer to my question? In fact it explicitly refers to his virtual environments, so this would not be system packages at all. Will someone please re-open my question, and stop this abusive closing of similar but different questions. – Elliptical view Jan 11 '21 at 16:27
  • `sudo` is the least interesting part here. "*Can I somehow find and uninstall these … packages…?*" — this is the main part and the linked dup clearly answers that. – phd Jan 11 '21 at 17:04
  • @phd, In my title line I put the word `sudo` twice. Then in the first sentence `sudo` 3 times, and once again a `sudo` in the last sentence. Furthermore, if you cared to look at the footnote, you would also see that this is all about `sudo`. Yes, I really do want to know how `sudo` plays with installing and uninstalling. I'm really quite baffled that you say that "`sudo` is the least interesting part here.", when it is about 90% of what I was trying to ask about. – Elliptical view Jan 12 '21 at 00:06
  • Here lives a pretty good set of answers to this question, as well as a general tutorial about where things get installed and uninstalled from in various situations: https://stackoverflow.com/a/58619629/1483904 Now I'll test it out. Thank you. – Elliptical view Jan 12 '21 at 02:07

0 Answers0