← All notes

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

Sources

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

Permanent ID: iil:note:ng1zz1vr

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.},
}

Markdown

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.

All artifact files (JSON index)

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.