nodejs/node · error · SystemError
invalid sysconfig.get_config_var('EXT_SUFFIX')
Error message
invalid sysconfig.get_config_var('EXT_SUFFIX') What it means
SystemError raised by packaging.tags when sysconfig.get_config_var('EXT_SUFFIX') returns a value that is not a non-empty string beginning with '.'. The function relies on EXT_SUFFIX to derive the running interpreter's ABI tag (e.g. cp310), so a malformed value means tag inference cannot proceed safely.
Source
Thrown at tools/gyp/pylib/packaging/tags.py:234
def _generic_abi() -> List[str]:
"""
Return the ABI tag based on EXT_SUFFIX.
"""
# The following are examples of `EXT_SUFFIX`.
# We want to keep the parts which are related to the ABI and remove the
# parts which are related to the platform:
# - linux: '.cpython-310-x86_64-linux-gnu.so' => cp310
# - mac: '.cpython-310-darwin.so' => cp310
# - win: '.cp310-win_amd64.pyd' => cp310
# - win: '.pyd' => cp37 (uses _cpython_abis())
# - pypy: '.pypy38-pp73-x86_64-linux-gnu.so' => pypy38_pp73
# - graalpy: '.graalpy-38-native-x86_64-darwin.dylib'
# => graalpy_38_native
ext_suffix = _get_config_var("EXT_SUFFIX", warn=True)
if not isinstance(ext_suffix, str) or ext_suffix[0] != ".":
raise SystemError("invalid sysconfig.get_config_var('EXT_SUFFIX')")
parts = ext_suffix.split(".")
if len(parts) < 3:
# CPython3.7 and earlier uses ".pyd" on Windows.
return _cpython_abis(sys.version_info[:2])
soabi = parts[1]
if soabi.startswith("cpython"):
# non-windows
abi = "cp" + soabi.split("-")[1]
elif soabi.startswith("cp"):
# windows
abi = soabi.split("-")[0]
elif soabi.startswith("pypy"):
abi = "-".join(soabi.split("-")[:2])
elif soabi.startswith("graalpy"):
abi = "-".join(soabi.split("-")[:3])
elif soabi:
# pyston, ironpython, others?
abi = soabiView on GitHub (pinned to 1b2de5e052)
Solutions
- Run `python -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))"` to inspect the actual value.
- Reinstall or rebuild the Python interpreter from a standard distribution so EXT_SUFFIX is set correctly.
- If unavoidable, call packaging.tags functions that accept explicit interpreter/platform arguments rather than auto-detection, or pin to a known-good interpreter in CI.
Example fix
# before (auto-derive on a broken interpreter)
from packaging.tags import sys_tags
abi = next(iter(sys_tags())).abi
# after
import sysconfig
ext = sysconfig.get_config_var('EXT_SUFFIX')
assert isinstance(ext, str) and ext.startswith('.'), ext
from packaging.tags import sys_tags Defensive patterns
Strategy: validation
Validate before calling
import sysconfig
def has_valid_ext_suffix() -> bool:
ext = sysconfig.get_config_var('EXT_SUFFIX')
return isinstance(ext, str) and ext.startswith('.') Try / catch
try:
from packaging.tags import sys_tags
tags = list(sys_tags())
except SystemError as e:
if 'EXT_SUFFIX' in str(e):
pass # fall back to explicit interpreter/platform tags Prevention
- Pin CI to a standard CPython distribution.
- Sanity-check sysconfig values at application startup in custom builds.
- Prefer explicit tag construction for embedded interpreters.
When it happens
Trigger: Running on a Python build where EXT_SUFFIX is None, empty, or lacks the leading dot - typically a broken, stripped, or unusual embeddable distribution, or a Python compiled without shared-module support. The warn=True _get_config_var already emitted a warning before this guard fires.
Common situations: Custom or embedded Python builds (e.g. conda variants, pyenv builds with odd configure flags, musl builds), CI images with a minimal Python, or environments where sysconfig data is incomplete.
Related errors
- Add ${this.npm.globalBin} to your $PATH
- Install git and ensure it's in your PATH.
- UND_ERR_INVALID_ARG
- Unable to locate a compiler for preprocessing assembly
- MB is expecting GN_ARGS to be in the environment
AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13).
Data as JSON: /api/errors/4b35fc2c244cff68.
Report an issue: GitHub.