platform.linux_distribution() deprecated - what are the alternatives?

According to Deprecated platform.linux_distribution() and platform.dist(), the platform.linux_distribution() will be removed from Python 3.7. It is indeed still present in Python 3.6. The recommended alternative is the distro package.

After installing the package, you can use the following code.

import distro
distro.linux_distribution()

In newer versions of the distro package, distro.linux_distribution() has been deprecated. Instead, the package makes available distro.id(), distro.version(), and distro.name().

Tags:

Python

Linux