Synopsis
Description
Search for a Python installation. Displays the path to the Python executable. Seeuv help python to view supported request formats and details on discovery behavior.
Arguments
[REQUEST]
The Python request.
When not provided, the Python requirement of a project in the current directory or parent directories will be used (unless --no-project is specified).
See uv help python to view supported request formats.
Examples:
3.12- Find Python 3.12[email protected]- Find CPython 3.11>=3.10- Find Python 3.10 or newerpython3.12- Find by executable name/usr/bin/python3- Find specific installation
Options
Discovery Options
--no-project
Avoid discovering a project or workspace.
Otherwise, when no request is provided, the Python requirement of a project in the current directory or parent directories will be used.
Aliases: --no-workspace
--system
Only find system Python interpreters.
By default, uv will report the first Python interpreter it would use, including those in an active virtual environment or a virtual environment in the current working directory or any parent directory.
The --system option instructs uv to skip virtual environment Python interpreters and restrict its search to the system path.
- Environment variable:
UV_SYSTEM_PYTHON - Conflicts with:
--no-system
--no-system
Allow finding Python in virtual environments.
This is the default behavior.
- Conflicts with:
--system
--script <SCRIPT>
Find the environment for a Python script, rather than the current project.
- Type: Path
- Conflicts with:
request,--no-project,--system,--no-system
Display Options
--show-version
Show the Python version that would be used instead of the path to the interpreter.
Example output: 3.12.4 instead of /usr/bin/python3.12
--resolve-links
Resolve symlinks in the output path.
When enabled, the output path will be canonicalized, resolving any symlinks.
Example:
- Without flag:
/usr/bin/python3(may be a symlink) - With flag:
/usr/lib/python3.12/bin/python3.12(resolved)
Custom Downloads
--python-downloads-json-url <PYTHON_DOWNLOADS_JSON_URL>
URL pointing to JSON of custom Python installations.
- Type: String
Version Request Formats
The following Python version request formats are supported:<version>e.g.3,3.12,3.12.3<version-specifier>e.g.>=3.12,<3.13<version><short-variant>e.g.,3.13t,3.12.0d<version>+<variant>e.g.,3.13+freethreaded,3.12.0+debug<implementation>e.g.cpythonorcp<implementation>@<version>e.g.[email protected]<implementation><version>e.g.cpython3.12orcp312<implementation><version-specifier>e.g.cpython>=3.12,<3.13<implementation>-<version>-<os>-<arch>-<libc>e.g.cpython-3.12.3-macos-aarch64-none
<executable-path>e.g./opt/homebrew/bin/python3<executable-name>e.g.mypython3<install-dir>e.g./some/environment/
Discovery Behavior
uv searches for Python in the following order:- Active virtual environment - If a virtual environment is activated
- Local virtual environment -
.venvin current or parent directories - Project Python requirement - From
pyproject.tomlor.python-version(unless--no-project) - Managed Python - Python versions installed by uv
- System Python - Python found in
PATH - Windows registry - On Windows only
--system, steps 1-2 are skipped.
Output Format
Default (Path)
With —show-version
With —resolve-links
Not Found
Examples
Find default Python
Find specific version
Find with version specifier
Find PyPy
Find system Python only
Find and show version
Find with resolved symlinks
Find for a specific script
my_script.py, considering inline script metadata.
Verify installation
Use in scripts
Check project Python
.python-version or pyproject.toml.
Find without project influence
Find exact executable
Use Cases
Verify Python availability
Get Python for external tools
Debug Python resolution
CI/CD validation
Compare installations
See Also
uv python install- Download and install Python versionsuv python list- List available Python installationsuv python pin- Pin to a specific Python versionuv python uninstall- Uninstall Python versions