Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/13634.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Patch scheme to posix_prefix if posix_local and --prefix is specified
6 changes: 6 additions & 0 deletions src/pip/_internal/locations/_sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ def get_scheme(
else:
scheme_name = _infer_prefix()

# Special case: When installing into a custom prefix, use posix_prefix
# instead of posix_local because it should be used only to redirecting
# to /usr/local.
if prefix is not None and scheme_name == "posix_local":
scheme_name = "posix_prefix"

# Special case: When installing into a custom prefix, use posix_prefix
# instead of osx_framework_library. See _should_use_osx_framework_prefix()
# docstring for details.
Expand Down