Closed issue by classabbyamp on void-packages repository https://github.com/void-linux/void-packages/issues/43703 Description: https://peps.python.org/pep-0668/ By adding a file `/usr/lib/python3.X/EXTERNALLY_MANAGED`, pip will not let users install python modules with `pip` outside of virtual environments ![image](https://user-images.githubusercontent.com/5366828/235501708-689a19a2-a6bf-451a-ab58-cba48f53bb5a.png) ### Pros - will prevent people from breaking xbps-installed python modules by using pip outside a venv ### Cons - breaks `pip install --user` too (can be [solved](https://bugs.gentoo.org/895410#c4)) - may break some void-based containers (or similar things) that install things with pip - solutions: - `pip --break-system-packages` - `doas pip config set install.break-system-packages True` - `noextract` on the EXTERNALLY-MANAGED file (could be done by default in void's official containers) ### Prior Art - gentoo implements this, see [here](https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-python/gentoo-common/gentoo-common-1.ebuild#n17) and [here](https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-lang/python/python-3.11.3.ebuild#n462) - ubuntu [apparently does this](https://ubuntuforums.org/showthread.php?t=2485257), but I can't find their source packages to check - Alpine implemented this for ~1 day until people complained that it broke their containers (this is probably less of a concern for void, and could be mitigated) - arch has not done this, from what I can tell - debian and fedora put distro-packaged python modules in a different directory, according to the PEP cc @void-linux/pkg-committers