Distro is a Python library that provides information about the operating system distribution it runs on, such as a reliable machine-readable ID and version information. It serves as a recommended replacement for Python's original platform.linux_distribution function, which was removed in Python 3.8. The current version is 1.9.0, released on October 5, 2023. The library is actively maintained with a stable release cadence, with the latest release being v1.9.0.
pip install distroVerified import paths — ran on the pinned version, not inferred.
A simple script to print the distribution ID, version, and name using the Distro library.
Use Distro's id(), version(), and name() functions instead.
Upgrade to Python 3.6 or later.
Use a virtual environment instead (https://pip.pypa.io/warnings/venv). If running pip as root is intentional and its implications are understood, use the --root-user-action option to suppress this warning.
Install the 'distro' library using pip: `pip install distro`
Install the 'distro' library (`pip install distro`) and replace calls to `platform.linux_distribution()` with `distro.linux_distribution()`, or preferably with `distro.id()`, `distro.name()`, and `distro.version()` for more granular information.
Replace `distro.linux_distribution()` calls with `distro.id()`, `distro.version()`, and `distro.name()` to retrieve specific distribution information.
Ensure you have a recent version of the `distro` library installed: `pip install --upgrade distro`. If the error persists, double-check the function name for typos.
Replace `distro.linux_distribution()` with appropriate `distro` API calls such as `distro.id()`, `distro.name()`, or `distro.version()`.