sysconfig — Access to Python's configuration information.
| Use Case | Command | Description |
|---|---|---|
| Get a specific config variable | sysconfig.get_config_var('LIBDIR') | Retrieve the value of one variable from the configuration dictionary |
| Get all config variables | sysconfig.get_config_vars() | Return a dictionary of all platform‑relevant configuration variables |
| Get an install‑scheme path | sysconfig.get_path('stdlib') | Return the filesystem path for a named scheme (e.g., 'stdlib', 'platlib') |
| Identify the current platform | sysconfig.get_platform() | Return a string like linux‑x86_64 or win‑amd64 |
| Python version string | sysconfig.get_python_version() | Return the Python version number |
| Locate pyconfig.h | sysconfig.get_config_h_filename() | Return the full path of the generated pyconfig.h header |
https://docs.python.org/3.10/library/sysconfig.html
The following documentation is automatically generated from the Python source files. It may be incomplete, incorrect or include features that are considered implementation detail and may vary between Python implementations. When in doubt, consult the module reference at the location listed above.
get_config_h_filename() — Return the path of pyconfig.h.get_config_var(name) — Return the value of a single variable using the dictionary returned by get_config_vars(). Equivalent to get_config_vars().get(name).get_config_vars(*args) — With no arguments, return a dictionary of all configuration variables relevant for the current platform. On Unix, this means every variable defined in Python's installed Makefile; on Windows it's a much smaller set. With arguments, return a list of values that result from looking up each argument in the configuration variable dictionary.get_makefile_filename() — Return the path of the Makefile.get_path(name, scheme='posix_local', vars=None, expand=True) — Return a path corresponding to the scheme. scheme is the install scheme name.get_path_names() — Return a tuple containing the paths names.get_paths(scheme='posix_local', vars=None, expand=True) — Return a mapping containing an install scheme. scheme is the install scheme name. If not provided, it will return the default scheme for the current platform.get_platform() — Return a string that identifies the current platform. This is used mainly to distinguish platform‑specific build directories and platform‑specific built distributions. Typically includes the OS name and version and the architecture (as supplied by os.uname()), although the exact information included depends on the OS; on Linux, the kernel version isn't particularly important.
Examples of returned values: linux‑i586, linux‑alpha (?), solaris‑2.6‑sun4u.
Windows will return one of: win‑amd64 (64‑bit Windows on AMD64) or win32 (all others). For other non‑POSIX platforms, currently just returns sys.platform.get_python_version()get_scheme_names() — Return a tuple containing the schemes names.parse_config_h(fp, vars=None) — Parse a config.h‑style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary.__all__ = ['get_config_h_filename', 'get_config_var', 'get_config_vars', ...]
/usr/lib/python3.10/sysconfig.py
Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 16:16 @216.73.216.114
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format