diff -urNp -x '*.orig' Python-3.9.2.org/Lib/distutils/command/install.py Python-3.9.2/Lib/distutils/command/install.py --- Python-3.9.2.org/Lib/distutils/command/install.py 2021-02-25 18:41:13.921266287 +0100 +++ Python-3.9.2/Lib/distutils/command/install.py 2021-02-25 18:41:15.634652993 +0100 @@ -9,6 +9,7 @@ from distutils import log from distutils.core import Command from distutils.debug import DEBUG from distutils.sysconfig import get_config_vars +from distutils.sysconfig import PREFIX, EXEC_PREFIX from distutils.errors import DistutilsPlatformError from distutils.file_util import write_file from distutils.util import convert_path, subst_vars, change_root @@ -419,8 +420,8 @@ class install(Command): raise DistutilsOptionError( "must not supply exec-prefix without prefix") - self.prefix = os.path.normpath(sys.prefix) - self.exec_prefix = os.path.normpath(sys.exec_prefix) + self.prefix = PREFIX + self.exec_prefix = EXEC_PREFIX else: if self.exec_prefix is None: diff -urNp -x '*.orig' Python-3.9.2.org/Lib/distutils/sysconfig.py Python-3.9.2/Lib/distutils/sysconfig.py --- Python-3.9.2.org/Lib/distutils/sysconfig.py 2021-02-25 18:41:13.927933162 +0100 +++ Python-3.9.2/Lib/distutils/sysconfig.py 2021-02-25 18:41:15.634652993 +0100 @@ -19,6 +19,10 @@ from .errors import DistutilsPlatformErr # These are needed in a couple of spots, so just compute them once. PREFIX = os.path.normpath(sys.prefix) EXEC_PREFIX = os.path.normpath(sys.exec_prefix) +if PREFIX == "/usr": + PREFIX = "/usr/local" +if EXEC_PREFIX == "/usr": + EXEC_PREFIX = "/usr/local" BASE_PREFIX = os.path.normpath(sys.base_prefix) BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix) diff -urNp -x '*.orig' Python-3.9.2.org/Lib/site.py Python-3.9.2/Lib/site.py --- Python-3.9.2.org/Lib/site.py 2021-02-25 18:41:13.924599724 +0100 +++ Python-3.9.2/Lib/site.py 2021-02-25 18:41:15.634652993 +0100 @@ -76,7 +76,7 @@ import _sitebuiltins import io # Prefixes for site-packages; add additional prefixes like /usr/local here -PREFIXES = [sys.prefix, sys.exec_prefix] +PREFIXES = ["/usr/local", sys.prefix, sys.exec_prefix] # Enable per user site-packages directory # set it to False to disable the feature or True to force the feature ENABLE_USER_SITE = None