Python hell
Hello guys,
In my system i have python packages from official repository and installed using pip. I have a single user. I also god knows why installed local and system wide packages using pip. Yesterday i updated the pip packages both system wide and user using this command
pip list --outdated --format=freeze | grep -v '\-e' | cut -d = -f 1 | xargs -n1 pip install -U
Now today when i update packages using pacman. Lot's of warning are shown. Can i just remove the site packages both system wide and user specific?
I happen to read the wiki about python after everything happened.
About this post
- Posted
- Archived
- Score
- 2 · 67% up
- Kind
- Text
- ID
- iamqlm
10 comments
It's a good thing, now you know that you better use
python -m venvthen use pip inside a venv instead of mixing python packages from pip and pacman :)Yeah, learned it the hard way :P
I had the same experience yeaaaaaars ago on Ubuntu, that's why I feel you :)
Also consider pipenv. It's a nice virtualenv wrapper that I found to be pretty comfortable
Try to uninstall the packages from pip that are also installed in pacman
I also done it with some package, but pip don't remove the files. And causes pacman to show file exist error. Can i just delete the site-package folder in python.
If the package isn't registered in pip then it should be safe to remove the files
Is the "some package" also a Python package, or another package from something like the AUR?
Local stuff is in .local/{bin,lib} The rest is in /usr/lib/python3.8/site-packages. I'd delete all things in those dirs first. Then download all python packages via pacman using pacman -S $(pacman -Qq | grep python- )