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..9b034091366 100644 --- a/src/pip/_internal/locations/_sysconfig.py +++ b/src/pip/_internal/locations/_sysconfig.py @@ -139,7 +139,7 @@ def get_scheme( scheme = Scheme( platlib=paths["platlib"], purelib=paths["purelib"], - headers=os.path.join(paths["include"], dist_name), + headers=os.path.join(paths["include"], dist_name or "UNKNOWN"), scripts=paths["scripts"], data=paths["data"], )