diff --git a/news/9838.bugfix.rst b/news/9838.bugfix.rst new file mode 100644 index 00000000000..0ae54bec8a4 --- /dev/null +++ b/news/9838.bugfix.rst @@ -0,0 +1 @@ +Fix compatibility between distutils and sysconfig when the project name is unknown. diff --git a/src/pip/_internal/locations/_sysconfig.py b/src/pip/_internal/locations/_sysconfig.py index e4d66d25d24..7e3ee6a22b9 100644 --- a/src/pip/_internal/locations/_sysconfig.py +++ b/src/pip/_internal/locations/_sysconfig.py @@ -136,6 +136,9 @@ def get_scheme( python_xy = f"python{get_major_minor_version()}" paths["include"] = os.path.join(base, "include", "site", python_xy) + if dist_name is None: + dist_name = "UNKNOWN" + scheme = Scheme( platlib=paths["platlib"], purelib=paths["purelib"],