Skip to main content

FindPython

A utility to find python versions on your system.

Tests PyPI PyPI - Python Version pdm-managed

Description

This library is a rewrite of pythonfinder project by @techalchemy. It simplifies the whole code structure while preserving most of the original features.

Installation

FindPython is installable via any kind of package manager including pip:

pip install findpython
Expand this section to see findpython's availability in the package ecosystem Packaging status

Usage

>>> import findpython
>>> findpython.find(3, 9)  # Find by major and minor version
<PythonVersion executable=PosixPath('/opt/homebrew/bin/python3.9'), version=<Version('3.9.10')>, architecture='64bit', major=3, minor=9, patch=10>
>>> findpython.find("3.9")  # Find by version string
<PythonVersion executable=PosixPath('/opt/homebrew/bin/python3.9'), version=<Version('3.9.10')>, architecture='64bit', major=3, minor=9, patch=10>
>>> findpython.find("3.9-32")  # Find by version string and architecture
<PythonVersion executable=WindowsPath('C:\\Python\\3.9-32\\python.exe'), version=<Version('3.9.10')>, architecture='32bit', major=3, minor=9, patch=10>
>>> findpython.find(name="python3")  # Find by executable name
<PythonVersion executable=PosixPath('/Users/fming/Library/PythonUp/bin/python3'), version=<Version('3.10.2')>, architecture='64bit', major=3, minor=10, patch=2>
>>> findpython.find("python3")  # Find by executable name without keyword argument, same as above
<PythonVersion executable=PosixPath('/Users/fming/Library/PythonUp/bin/python3'), version=<Version('3.10.2')>, architecture='64bit', major=3, minor=10, patch=2>
>>> findpython.find_all(major=3, minor=9)  # Same arguments as `find()`, but return all matches
[<PythonVersion executable=PosixPath('/opt/homebrew/bin/python3.9'), version=<Version('3.9.10')>, architecture='64bit', major=3, minor=9, patch=10>, <PythonVersion executable=PosixPath('/opt/homebrew/bin/python3'), version=<Version('3.9.10')>, architecture='64bit', major=3, minor=9, patch=10>, <PythonVersion executable=PosixPath('/Users/fming/Library/PythonUp/cmd/python3.9'), version=<Version('3.9.9')>, architecture='64bit', major=3, minor=9, patch=9>, <PythonVersion executable=PosixPath('/usr/local/bin/python3.9'), version=<Version('3.9.5')>, architecture='64bit', major=3, minor=9, patch=5>, <PythonVersion executable=PosixPath('/usr/local/bin/python3'), version=<Version('3.9.5')>, architecture='64bit', major=3, minor=9, patch=5>]

CLI Usage

In addition, FindPython provides a CLI interface to find python versions:

usage: findpython [-h] [-V] [-a] [--resolve-symlink] [-v] [--no-same-file] [--no-same-python] [--providers PROVIDERS]
                  [version_spec]

A utility to find python versions on your system

positional arguments:
  version_spec          Python version spec or name

options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -a, --all             Show all matching python versions
  --resolve-symlink     Resolve all symlinks
  -v, --verbose         Verbose output
  --no-same-file        Eliminate the duplicated results with the same file contents
  --no-same-python      Eliminate the duplicated results with the same sys.executable
  --providers PROVIDERS
                        Select provider(s) to use

Integration

FindPython finds Python from the following places:

  • PATH environment variable
  • pyenv install root
  • asdf python install root
  • rye toolchain install root
  • uv toolchain install root
  • /Library/Frameworks/Python.framework/Versions (MacOS)
  • Windows registry (Windows only)

License

FindPython is released under MIT License.

Metadata

Release files for findpython 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for findpython 0.7.0
File Size Uploaded Provenance Actions
findpython-0.7.0.tar.gz 18.9 kB Without provenance Details for findpython-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for findpython 0.7.0
File Interpreter ABI Platform Actions
findpython-0.7.0-py3-none-any.whl Python 3 none any Details for findpython-0.7.0-py3-none-any.whl

Total release size: 40.8 kB

Release files / findpython-0.7.0.tar.gz

Download URL findpython-0.7.0.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8b31647c76352779a3c1a0806699b68e6a7bdc0b5c2ddd9af2a07a0d40c673dc
BLAKE2b-256 checksum
How to use checksums
1a175a72566eecc9cbc1609459befe9f7dc65e101b66519a79999cc48044993c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / findpython-0.7.0-py3-none-any.whl

Download URL findpython-0.7.0-py3-none-any.whl
Size 22.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f53cfcc29536f5b83c962cf922bba8ff6d6a3c2a05fda6a45aa58a47d005d8fc
BLAKE2b-256 checksum
How to use checksums
70e500c2aec929c3068eb6b18d4da4a13a12fd6de040a50c78bbc3c222aebdca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Security for findpython 0.7.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page