A Python library that provides lists of all standard library modules for various Python versions (currently 2.7 through 3.14). It is actively maintained with updates for new Python releases. This library is particularly useful for static analysis and tooling that needs to differentiate between standard library and third-party modules. For Python 3.10 and newer, `sys.stdlib_module_names` offers similar functionality.
pip install stdlib-listVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to import `stdlib_list` and retrieve the list of standard library modules for a specific Python version, or for the latest version supported by the package.
Consider using `sys.stdlib_module_names` or `sys.builtin_module_names` for newer Python versions.
Upgrade your Python environment to 3.9+ or pin `stdlib-list` to a version older than 0.11.0 (e.g., `stdlib-list==0.10.0`).
Uninstall `types-stdlib-list` if your `stdlib-list` version is 0.9.0 or greater to avoid potential conflicts or redundant dependencies.
Ensure you are referencing the official `pypi/stdlib-list` GitHub repository and PyPI page for the most up-to-date information and project status.
pip install stdlib-list
from stdlib_list import stdlib_list
supported_versions = stdlib_list.get_supported_versions()
# Use one of the supported version strings, e.g., stdlib_list.get_stdlib_list('3.9')from stdlib_list import stdlib_list
# Call methods directly on the imported 'stdlib_list' object, without parentheses
python_38_stdlib = stdlib_list.get_stdlib_list('3.8')