sysconfig: installation paths and configuration variables
Answer: sysconfig exposes Python's configuration: installation paths and the variables that apply on the current platform. get_config_vars() returns a dictionary of those variables. get_config_var(name) returns one value, or None if the name is missing.
Configuration variables
Use sysconfig when you need installation paths or the configuration variables for this platform.
A distribution ships a Makefile and a pyconfig.h header, both needed to build the interpreter and C extensions that use setuptools.
sysconfig puts those variables in a dictionary. Access it using get_config_vars() or get_config_var().
On Windows the set is much smaller.
Called with no arguments, get_config_vars() returns the full dictionary for this platform.
Called with names, it returns a list of looked-up values, one per argument.
get_config_var(name) returns that one value, or None when the name is absent.
The same facts in the source document
The reStructuredText source describes the same access to paths and platform variables.
get_config_var(name) is written as equivalent to get_config_vars().get(name).
See also
Claims
- id: C1 claim: sysconfig exposes installation paths and platform configuration variables. source: S1 evidence: "list of installation paths and the configuration variables"
- id: C2 claim: Variables come from Makefile and pyconfig.h. source: S1 evidence: "Makefile and a pyconfig.h header file"
- id: C3 claim: get_config_vars() with no arguments returns the full dictionary. source: S1 evidence: "dictionary of all configuration variables"
- id: C4 claim: get_config_var returns None when the name is missing. source: S1 evidence: "If name is not found, return None"
- id: C5 claim: get_config_var(name) equals get_config_vars().get(name). source: S2 evidence: "get_config_vars().get(name)"
Sources
- [S1] sysconfig — Provide access to Python’s configuration information. Python Software Foundation. https://docs.python.org/3/library/sysconfig.html . License: PSF License Version 2. Accessed 2026-11-23.
- [S2] sysconfig documentation (source). CPython. https://raw.githubusercontent.com/python/cpython/main/Doc/library/sysconfig.rst . License: PSF License Version 2. Accessed 2026-11-23.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, sysconfig — Provide access to Python’s configuration information; CPython, sysconfig documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, sysconfig — Provide access to Python’s configuration information; CPython, sysconfig documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation.
Cite this
iinventedlight. 2026. "sysconfig: installation paths and configuration variables." iinventedlight Library, iil:note:ng1zz1vr, version of 2026-11-23. https://iinventedlight.com/library/notes/python-sysconfig/. License: CC-BY-4.0.
@misc{iil_note_ng1zz1vr,
author = {{iinventedlight}},
title = {{sysconfig: installation paths and configuration variables}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-23},
url = {https://iinventedlight.com/library/notes/python-sysconfig/},
note = {Permanent ID iil:note:ng1zz1vr. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- python-sysconfig.schema.json (schema; CC-BY-4.0)
- python-sysconfig.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/python-sysconfig.md.