You are not logged in.
After a pacman -Syu python suddenly complained that regex module was no longer found.
A pip install regex fixed it again, but I would like to understand why something like that even happened in the first place.
Any ideas?
Offline
The python regex installation got broken by mixing package managers. Do not run pip as root and use packages for system level installations: https://wiki.archlinux.org/title/Python … management -- note the sentence after the list reccommending to use venvs or user level installations of pip for projects.
For this concrete case you should have https://archlinux.org/packages/communit … hon-regex/ installed. If you install that now you'll likely get file conflicts due to the pip installation being plastered over it.
Last edited by V1del (2023-05-17 10:41:35)
Offline
Thanks. I always used "pip install.." as it was recommended everywhere where you get in contact with python scripting. So that's actually wrong and need to use pacman packages instead and only fall back to pip if no such package is available? (And never run pip as root, so installation is user-wide only.)
Last edited by millus (2023-05-17 13:08:58)
Offline
The problem with everywhere is that these resources are mostly targeted at Windows users where python simply doesn't exist in a system context so running pip install willy nilly will have not much effect there. In contrast since a bunch of python stuff is quite ingrained in the linux ecosystem using pip install as root will create a disjoint between the system level packages and ones you might use for personal one-off/scripting projects.
That general approach is likely to bring you further generally, if you are developing on a project that has actual hard version requirements on things you'll want to set them up in an isolated manner in venvs.
Offline
python is being managed by the system package manager (pacman). Anything else installed from the official repos will be managed for you, and rebuilt against the new version of python. Anything outside of the official repos, including things installed with pip, are your responsibility to manage and update when required.
Offline