What's the problem this feature will solve?
On Debian systems, due to the sysconfig patch, sysconfig.get_preferred_scheme('prefix') will return posix_local, which is also the default scheme. This causes problem when using --prefix <path> with pip install, where packages are installed to <prefix_path>/local/lib/pythonX.Y/dist-packages. This is apparently wrong.
Describe the solution you'd like
Add a special case to pip._internal.locations._sysconfig:get_scheme(), when posix_local is found in INSTALL_SCHEMES and prefix is not None, rewrite the scheme as posix_prefix.
Alternative Solutions
I am not sure if it is better to report it to Debian, but IMO it makes more sense to fix it in pip to be more robust.
Additional context
Code of Conduct
What's the problem this feature will solve?
On Debian systems, due to the sysconfig patch,
sysconfig.get_preferred_scheme('prefix')will returnposix_local, which is also the default scheme. This causes problem when using--prefix <path>withpip install, where packages are installed to<prefix_path>/local/lib/pythonX.Y/dist-packages. This is apparently wrong.Describe the solution you'd like
Add a special case to
pip._internal.locations._sysconfig:get_scheme(), whenposix_localis found inINSTALL_SCHEMESandprefixis not None, rewrite the scheme asposix_prefix.Alternative Solutions
I am not sure if it is better to report it to Debian, but IMO it makes more sense to fix it in
pipto be more robust.Additional context
Code of Conduct