Python sysconfig Module
Example
Get Python installation paths:
import sysconfig
print(f'Platform: {sysconfig.get_platform()}')
print(f'Python version: {sysconfig.get_python_version()}')
Try it Yourself »
Definition and Usage
The sysconfig module provides access to Python's configuration information.
Use it to query installation paths, compiler flags, platform information, or build-time configuration details.
Members
| Member | Description |
|---|---|
| get_config_var() | Return the value of a single configuration variable. |
| get_config_vars() | Return dictionary of all configuration variables. |
| get_path() | Return installation path for a scheme and name. |
| get_path_names() | Return list of path names available in scheme. |
| get_paths() | Return dictionary of installation paths. |
| get_platform() | Return string identifying the current platform. |
| get_python_version() | Return Python version as a string. |
| get_scheme_names() | Return tuple of valid installation scheme names. |