Live data from Hacker News

Python environment setup seems complicated and unsolvable

stackoverflow.com

31–34 of 34 posts

Re: Python environment setup seems complicated and unsolvable

#31
post #27

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 yo…

Arch 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/py...

https://peps.python.org/pep-0668/

Re: Python environment setup seems complicated and unsolvable

#32
post #27

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 yo…

Not to mention most of the pain people experience with activating venvs can be mitigated by running the Python binary directly

./venv/bin/python3

Re: Python environment setup seems complicated and unsolvable

#33
post #27

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 yo…

Arch 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/py... https://peps.python.org/pep-0668/

With 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.

Re: Python environment setup seems complicated and unsolvable

#34
post #33

Earlier quoted context omitted.

Arch 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/py... https://peps.python.org/pep-0668/

With 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.

Yes on arch you can only install packages with `--break-system-packages`. But you can't accidentally mix up system packages with pip.
Post reply on HN