[issue43312] Interface to select preferred "user" or "home" sysconfig scheme for an environment

Matthias Klose report at bugs.python.org
Tue Mar 9 07:41:48 EST 2021


Matthias Klose <doko at debian.org> added the comment:

The Debian/Ubuntu packages have a local patch for distutils/setuptools introducing an --install-layout option.  Maybe have the same for pip?

The intention with renaming/moving site-packages to /usr/lib/python3/dist-packages is to avoid users damaging their system installation, like

  sudo python3 setup.py install
  sudo pip install

overriding packages installed with the distro package manager. Just making this schema known, and making it the default would again allow pip acting on packages managed by the distro package manager.

Otoh, there are use cases, where you want to use the Python provided by the Linux distro and run into issues with the custom dist-packages.

 - Creating a venv using the system Python probably should use
   the versioned site-packages.

 - Building on top of a docker image for e.g. a Python App, you
   probably want to install into the dist-packages provided by
   the system Python.

So the problem to solve is

 - let a "sudo pip install" fail by default on the real system
 - let the same install succeed in a docker environment, or any
   other "image".
 - behave transparently on venv and virtualenv installations.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43312>
_______________________________________


More information about the Python-bugs-list mailing list