4 ms·
My 2 cents: Since I use a Arch based Linux distribution, I like to update my (main) Python environment just as frequently: at least once a week. My findings so
by mharig 3y ago
My 2 cents:
Since I use a Arch based Linux distribution, I like to update my (main) Python environment just as frequently: at least once a week. My findings so far:
1. Do not interfere with the system managed packages. I.e. use --user when pip install or make the system python lib dir(s) non-writable for the user
2. If you don't like to switch frequently into another venv, just put the packages that interfere with your main (user) env into separate venvs. These are normally young and intensely developed modules, like e.g. textual, or old non-updated modules, like e.g. ecs, or complicated, cross-language stuff, like e.g. numba, scipy. They will separate themselves out after a while.
3. If nonetheless some local packages interfere with system packages (btw, I hate the --break-system-packages crap), make separate users each with the appropriate environment.
Rinse and repeat.
- SushiHippie 3y agoArch has set python to externally managed since June, so you can't mix system python packages with pip installed ones. https://gitlab.archlinux.org/archlinux/packaging/packages/python/-/commit/547eee4deb54fda2a3892997145b57de37301c5d https://gitlab.archlinux.org/archlinux/packaging/packages/py... https://peps.python.org/pep-0668/ https://peps.python.org/pep-0668/
- mharig 3y agoWith sudo pip you can. But I was thinking of other Linux distributions. The ones that caused the introduction of --break-system-packages. And it prevents less a mixing than a shadowing of system packages with local packages.
- SushiHippie 3y agoYes on arch you can only install packages with `--break-system-packages`. But you can't accidentally mix up system packages with pip.
- stevenhuang 3y agoNot to mention most of the pain people experience with activating venvs can be mitigated by running the Python binary directly ./venv/bin/python3