#### Other tools - [`hatch python show`](https://hatch.pypa.io/latest/cli/reference/#hatch-python-show) - [`pdm python list`](https://pdm-project.org/en/latest/reference/cli/#list_2) - [`uv python list`](https://docs.astral.sh/uv/reference/cli/#uv-python-list) - [`pipx interpreter list`](https://pipx.pypa.io/latest/docs/#pipx-interpreter) - [`pymanager list`](https://peps.python.org/pep-0773/#list-subcommand) #### Purpose List all of the discovered interpreters. #### Notes - [Discourse discussion](https://discuss.python.org/t/what-information-is-useful-to-know-statically-about-an-interpreter/25563) - [PEP 711 cross-post](https://discuss.python.org/t/pep-711-pybi-a-standard-format-for-distributing-python-binaries/25547/14?u=brettcannon) - `--format`: Specify the output format; all output in UTF-8 - `jsonl`: Print [interpreter details](https://github.com/brettcannon/python-launcher/discussions/168) using [JSON Lines](https://jsonlines.org/) - This should work with [`json -o` for Nu](https://www.nushell.sh/commands/docs/from_json.html) - Results are streamed as results are found instead of being sorted - Fields - `version` - `path` - `virtual`? - Can be inferred based on how the environment was found - `via` - `$VIRTUAL_ENV` - `.venv` - `$PATH` - `pretty` (default): Print interpreter details in a format designed to be human-readable - Include same details as the JSONL output - Sorted by how "good" the interpreter is - `--ignore-venv`: Ignore virtual environments (or default to `--include-venv`)? - Might be unnecessary or only useful via `--one` - `--one` - Only print the path to the "best" interpreter - https://github.com/python/cpython/issues/102522 would give more accurate version info for virtual environments # Launcher for Windows ```PowerShell PS C:\Users\brcan> py list --format=formats Format Description table Lists as a user-friendly table csv List as a comma-separated value table json Lists as a single JSON object jsonl Lists as JSON on each line id Lists the runtime ID exe Lists the main executable path prefix Lists the prefix directory url Lists the original source URL legacy List runtimes using the old format legacy-paths List runtime paths using the old format formats List the available list formats ``` ## "tables" / default ``` Tag Name Managed By Version Alias 3.14[-64] * Python 3.14.0 PythonCore 3.14.0 python3[-64].exe, python3.14[-64].exe 3.14t[-64] Python 3.14.0 (free-threaded) PythonCore 3.14.0 python3.14t[-64].exe, python3t[-64].exe 3.13[-64] Python 3.13.8 PythonCore 3.13.8 python3.13[-64].exe 3.13t[-64] Python 3.13.8 (free-threaded) PythonCore 3.13.8 python3.13t[-64].exe 3.12[-64] Python 3.12.10 PythonCore 3.12.10 python3.12[-64].exe 3.11[-64] Python 3.11.9 PythonCore 3.11.9 python3.11[-64].exe 3.10[-64] Python 3.10.11 PythonCore 3.10.11 python3.10.exe ``` ## JSONL ```json {"schema": 1, "id": "pythoncore-3.10-64", "sort-version": "3.10.11", "company": "PythonCore", "tag": "3.10-64", "install-for": ["3.10.11-64", "3.10-64", "3-64"], "run-for": [{"tag": "3.10.11-64", "target": "python.exe"}, {"tag": "3.10-64", "target": "python.exe"}, {"tag": "3-64", "target": "python.exe"}, {"tag": "3.10.11-64", "target": "pythonw.exe", "windowed": 1}, {"tag": "3.10-64", "target": "pythonw.exe", "windowed": 1}, {"tag": "3-64", "target": "pythonw.exe", "windowed": 1}], "alias": [{"name": "python3.10.exe", "target": "python.exe"}, {"name": "python3.exe", "target": "python.exe"}, {"name": "pythonw3.10.exe", "target": "pythonw.exe", "windowed": 1}, {"name": "pythonw3.exe", "target": "pythonw.exe", "windowed": 1}], "shortcuts": [{"kind": "pep514", "Key": "PythonCore\\3.10", "DisplayName": "Python 3.10.11", "SupportUrl": "https://www.python.org/", "SysArchitecture": "64bit", "SysVersion": "3.10", "Version": "3.10.11", "InstallPath": {"_": "%PREFIX%", "ExecutablePath": "%PREFIX%python.exe", "WindowedExecutablePath": "%PREFIX%pythonw.exe"}, "Help": {"Online Python Documentation": {"_": "https://docs.python.org/3.10/"}}}, {"kind": "start", "Name": "Python 3.10", "Items": [{"Name": "Python 3.10", "Target": "%PREFIX%python.exe", "Icon": "%PREFIX%python.exe"}, {"Name": "Python 3.10 Online Documentation", "Icon": "%SystemRoot%\\System32\\SHELL32.dll", "IconIndex": 13, "Target": "https://docs.python.org/3.10/"}]}, {"kind": "uninstall", "Publisher": "Python Software Foundation", "HelpLink": "https://docs.python.org/3.10/"}], "display-name": "Python 3.10.11", "executable": "C:\\Users\\brcan\\AppData\\Local\\Python\\pythoncore-3.10-64\\python.exe", "url": "https://api.nuget.org/v3-flatcontainer/python/3.10.11/python.3.10.11.nupkg", "__original-shortcuts": [{"kind": "pep514", "Key": "PythonCore\\3.10", "DisplayName": "Python 3.10.11", "SupportUrl": "https://www.python.org/", "SysArchitecture": "64bit", "SysVersion": "3.10", "Version": "3.10.11", "InstallPath": {"_": "%PREFIX%", "ExecutablePath": "%PREFIX%python.exe", "WindowedExecutablePath": "%PREFIX%pythonw.exe"}, "Help": {"Online Python Documentation": {"_": "https://docs.python.org/3.10/"}}}, {"kind": "start", "Name": "Python 3.10", "Items": [{"Name": "Python 3.10", "Target": "%PREFIX%python.exe", "Icon": "%PREFIX%python.exe"}, {"Name": "Python 3.10 Online Documentation", "Icon": "%SystemRoot%\\System32\\SHELL32.dll", "IconIndex": 13, "Target": "https://docs.python.org/3.10/"}]}, {"kind": "uninstall", "Publisher": "Python Software Foundation", "HelpLink": "https://docs.python.org/3.10/"}], "source": "https://www.python.org/ftp/python/index-windows.json", "prefix": "C:\\Users\\brcan\\AppData\\Local\\Python\\pythoncore-3.10-64"} ```