mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Add documentation for uv python find
(#6527)
In part, for https://github.com/astral-sh/uv/pull/6521
This commit is contained in:
parent
80b5384a4d
commit
e0abab8259
1 changed files with 28 additions and 0 deletions
|
@ -134,6 +134,34 @@ To exclude downloads and only show installed Python versions:
|
|||
$ uv python list --only-installed
|
||||
```
|
||||
|
||||
## Finding a Python executable
|
||||
|
||||
To find a Python executable, use the `uv python find` command:
|
||||
|
||||
```console
|
||||
$ uv python find
|
||||
```
|
||||
|
||||
By default, this will display the path to the first available Python executable. See the
|
||||
[discovery rules](#discovery-of-python-versions) for details about how executables are discovered.
|
||||
|
||||
This interface also supports many [request formats](#requesting-a-version), e.g., to find a Python
|
||||
executable that has a version of 3.11 or newer:
|
||||
|
||||
```console
|
||||
$ uv python find >=3.11
|
||||
```
|
||||
|
||||
By default, `uv python find` will include Python versions from virtual environments. If a `.venv`
|
||||
directory is found in the working directory or any of the parent directories or the `VIRTUAL_ENV`
|
||||
environment variable is set, it will take precedence over any Python executables on the `PATH`.
|
||||
|
||||
To ignore virtual environments, use the `--system` flag:
|
||||
|
||||
```console
|
||||
$ uv python find --system
|
||||
```
|
||||
|
||||
## Discovery of Python versions
|
||||
|
||||
When searching for a Python version, the following locations are checked:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue