pyversions
List installed Python versions
SYNOPSIS
pyversions [options]
PARAMETERS
-r
Prints only the default Python runtime version (e.g., "python3").
-s
Formats output in a style suitable for shell scripts, often space-separated versions.
-i
Displays versions along with their installation paths or additional installation details.
-d
Provides detailed information for each version, potentially including architecture.
-V
Shows the version information for the pyversions command itself.
-h, --help
Displays a help message and exits.
DESCRIPTION
pyversions is a utility designed for Debian-based systems to display a list of Python versions installed and managed through the python-minimal package and the update-alternatives system.
It provides a quick way to ascertain which Python interpreters are available for use in scripting and development. This command helps users and package maintainers understand the Python environment setup, especially relevant in systems where multiple major Python versions (like Python 2 and Python 3) coexist.
It is particularly useful for identifying the default Python runtime and other available versions, aiding in proper script execution and dependency management.
CAVEATS
This command is primarily available and relevant on Debian-based Linux distributions (e.g., Ubuntu). It relies on the update-alternatives system and the python-minimal package for its functionality. It may not be present or behave similarly on other Linux distributions or operating systems.
PACKAGE SOURCE
The pyversions command is typically provided by the python-minimal package on Debian and Ubuntu distributions.
ROLE IN PYTHON ECOSYSTEM
It acts as a simple interface to query the system's awareness of installed Python versions, which are often configured using the update-alternatives system to manage the default python command.
HISTORY
The pyversions command emerged as part of Debian's system for managing multiple Python interpreters, particularly with the transition from Python 2 to Python 3. It became especially relevant when both major versions were commonly installed, and system utilities or user scripts might depend on a specific python executable. It helps identify which versions are available and how the system's python symlink might be configured via update-alternatives. While its direct usage might decrease as Python 2 becomes obsolete, it remains a useful diagnostic tool on Debian-based systems for understanding Python environment configurations.
SEE ALSO
update-alternatives(8), python(1), python2(1), python3(1)