From python3.11.spec: # 00251 # af0f1ba72e01cb93371ff21fb7ca889daa43fa7a # Change user install location # # Set values of base and platbase in sysconfig from /usr # to /usr/local when RPM build is not detected # to make pip and similar tools install into separate location. # # Set values of prefix and exec_prefix in distutils install command # to /usr/local if executable is /usr/bin/python* and RPM build # is not detected to make distutils and pypa/distutils install into separate location. # # Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe # Downstream only. # # We've tried to rework in Fedora 36/Python 3.10 to follow https://bugs.python.org/issue43976 # but we have identified serious problems with that approach, # see https://bugzilla.redhat.com/2026979 or https://bugzilla.redhat.com/2097183 # # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch
Previously tracked in BZ#1287556.
The next step is aligning with PEP 668: https://peps.python.org/pep-0668/ Change proposal draft: https://fedoraproject.org/wiki/Changes/PythonMarkExternallyManaged But there are some issues: https://discuss.python.org/t/pep-668-marking-python-base-environments-as-externally-managed/10302/46