-
Couldn't load subscription status.
- Fork 3.2k
Open
Labels
project: <downstream>When the cause/effect is related to redistributorsWhen the cause/effect is related to redistributorstype: bugA confirmed bug or unintended behaviorA confirmed bug or unintended behavior
Description
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
- https://salsa.debian.org/cpython-team/python3/-/blob/master/debian/patches/sysconfig-debian-schemes.diff
- python3.10+: global pip install layout does not match debian's due to sysconfig changes deadsnakes/issues#182
- Debian bug report
Code of Conduct
- I agree to follow the PSF Code of Conduct.
Metadata
Metadata
Assignees
Labels
project: <downstream>When the cause/effect is related to redistributorsWhen the cause/effect is related to redistributorstype: bugA confirmed bug or unintended behaviorA confirmed bug or unintended behavior