diff --git a/src/pip/_internal/locations/_sysconfig.py b/src/pip/_internal/locations/_sysconfig.py index e4d66d25d24..75f3491cd97 100644 --- a/src/pip/_internal/locations/_sysconfig.py +++ b/src/pip/_internal/locations/_sysconfig.py @@ -54,7 +54,10 @@ def _infer_prefix(): def _infer_user(): # type: () -> str """Try to find a user scheme for the current platform.""" - suffixed = f"{os.name}_user" + if sysconfig.get_config_var("PYTHONFRAMEWORK"): # Mac framework build. + suffixed = "osx_framework_user" + else: + suffixed = f"{os.name}_user" if suffixed in _AVAILABLE_SCHEMES: return suffixed if "posix_user" not in _AVAILABLE_SCHEMES: # User scheme unavailable.