python-discovery
What is python-discovery?
python-discovery is a library for discovering Python interpreters installed on your machine. You may have multiple
Python versions from system packages, pyenv, mise,
asdf, uv, or the Windows registry (PEP 514). This library finds
the right one for you.
Give it a requirement like python3.12 or >=3.11,<3.13, and it searches all known locations, verifies each candidate,
and returns detailed metadata about the match. Results are cached to disk so repeated lookups are fast.
The library runs on Python 3.8+ and discovers interpreters as old as Python 3.6; anything older is skipped with a warning naming the version it found.
Usage
from pathlib import Path
from python_discovery import DiskCache, get_interpreter
cache = DiskCache(root=Path("~/.cache/python-discovery").expanduser())
result = get_interpreter("python3.12", cache=cache)
if result is not None:
print(result.executable) # /usr/bin/python3.12
print(result.implementation) # CPython
print(result.version_info[:3]) # (3, 12, 1)
The get_interpreter() function accepts various specification formats:
- Absolute path:
/usr/bin/python3.12 - Version:
3.12 - Implementation prefix:
cpython3.12 - Version specifier:
>=3.10,>=3.11,<3.13
Documentation
Full documentation is available at python-discovery.readthedocs.io
Metadata
Release files for python-discovery 1.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python_discovery-1.6.1.tar.gz | 84.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_discovery-1.6.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 123.0 kB
Release files / python_discovery-1.6.1.tar.gz
| Download URL | python_discovery-1.6.1.tar.gz |
|---|---|
| Size | 84.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf87d3627dfb4412437fdd5b13eae402607722998d21567993aedbc59b23c15e
|
|
BLAKE2b-256 checksum How to use checksums |
0c57250bd238b966cece44328235eb85290045d059265fdaf7527a3a958123db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logRelease files / python_discovery-1.6.1-py3-none-any.whl
| Download URL | python_discovery-1.6.1-py3-none-any.whl |
|---|---|
| Size | 38.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d43fcdef879fe795352bd13ccf8d185ba5a9f86f36cfcd00529f596e737442b3
|
|
BLAKE2b-256 checksum How to use checksums |
167de9ffbadfbf89c93848412d04594135c4ae8c1d37d9e053b9c3ed718fabc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency log