I'd like to "reset" my Python installation and start from fresh
Like many other Arch users, my python install messed up after updating to Python 3.11
As many have advised, I should use virtualenv, which is what I will be doing. But I'd like to remove all the "junk" that I have installed using pip from the CLI without removing the modules that are used by software I use as that would break them.
Is this possible?
About this post
- Posted
- Archived
- Score
- 14 · 85% up
- Kind
- Text
- ID
- 13dptdk
12 comments
If you used pip as your user, just delete the python folders from $HOME
Would this not break the software that may depend on certain modules?
Or does are python installed somewhere else when you install software through pacman?
pacman handles all the deps for anything you install trough it.
Depends on how you ran pip.
Pip should never be ran as root. If you ran pip as root - your system is broken. Dumping a list of all installed packages, booting from a usb stick, mounting your root partition, deleting everything in /usr/local/lib/python* and then reinstalling the packages from the list is the easiest way to solve the problem.
If you ran pip as your user (by passing --user) - just follow what /u/MrElendig said.
Please update us as to how you ended up fixing this situation. Tks
I followed what u/MrElendig said :)
Tks! Hopefully, this will help others.
Just a guide for If it happens again: you have most PIP packages with pacman
python-<package-name>. then you can just reinstall those.I haven't tested this, but theoretically it should work if you ever ran pip as root and installed python packages into the system site-packages.
You might be able to find junk you installed with
sudo pipby running:Everything in there should be owned by a package. Anything that isn't can (probably) be deleted, because at least nothing you installed with pacman will depend on it.