Skip to content

Commit 555bf89

Browse files
Add document for specifying Python interpreter in tool installation and upgrade commands. (#11598)
<!-- Thank you for contributing to uv! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary Just to add the section for installing and upgrading uv tool, specifying the Python version, in the document. Originally, it was planned to add a markdown block (header) for representation, but it was felt to be a bit redundant, so it ended up being like this. close #11536 ## Test Plan Run doc server with strict mode in local. (``mkdocs serve -f mkdocs.public.yml --strict``) ![image](https://github.com/user-attachments/assets/9da66a8b-5423-4937-bc66-ea696ad1ab88) <!-- How was it tested? --> --------- Signed-off-by: FishAlchemist <[email protected]> Co-authored-by: Zanie Blue <[email protected]>
1 parent 3634a4d commit 555bf89

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/guides/tools.md

+27
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,33 @@ To instead upgrade all tools:
237237
$ uv tool upgrade --all
238238
```
239239

240+
## Requesting Python versions
241+
242+
By default, uv will use your default Python interpreter (the first it finds) when when running,
243+
installing, or upgrading tools. You can specify the Python interpreter to use with the `--python`
244+
option.
245+
246+
For example, to request a specific Python version when running a tool:
247+
248+
```console
249+
$ uvx --python 3.10 ruff
250+
```
251+
252+
Or, when installing a tool:
253+
254+
```console
255+
$ uv tool install --python 3.10 ruff
256+
```
257+
258+
Or, when upgrading a tool:
259+
260+
```console
261+
$ uv tool upgrade --python 3.10 ruff
262+
```
263+
264+
For more details on requesting Python versions, see the
265+
[Python version](../concepts/python-versions.md#requesting-a-version) concept page..
266+
240267
## Next steps
241268

242269
To learn more about managing tools with uv, see the [Tools concept](../concepts/tools.md) page and

0 commit comments

Comments
 (0)