Skip to main content

python-discovery

PyPI Supported Python versions Downloads check Documentation Status

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_discovery-1.5.2.tar.gz (82.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_discovery-1.5.2-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

File details

Details for the file python_discovery-1.5.2.tar.gz.

File metadata

  • Download URL: python_discovery-1.5.2.tar.gz
  • Upload date:
  • Size: 82.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for python_discovery-1.5.2.tar.gz
Algorithm Hash digest
SHA256 45fd4f20a4e3f9b7bf2e0817870bc8e3b320a19658da177af800768c82dbf354
MD5 e97e8c55611027077fee072458422923
BLAKE2b-256 38b7ac44da2cf0e53ada0e419033c2d058219c95dc1403126f163304c9e814b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_discovery-1.5.2.tar.gz:

Publisher: release.yaml on tox-dev/python-discovery

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_discovery-1.5.2-py3-none-any.whl.

File metadata

File hashes

Hashes for python_discovery-1.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3e338c2d0f15dfaeea57493f4c2c6caebe0e998ea815c30ae8bf8ee21f1112d3
MD5 c2db47652fd7607abe401d441622cae1
BLAKE2b-256 7145689603d04b3bb8d7faa00f25c24acef993aab7813b3dbbfc472a459ab0b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_discovery-1.5.2-py3-none-any.whl:

Publisher: release.yaml on tox-dev/python-discovery

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.5.3

2 files

This release

1.5.2 This release

2 files

1.5.1

2 files

1.5.0

2 files

1.4.4

2 files

1.4.3

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page