Skip to content

Commit c8fb12c

Browse files
committed
Cover --python <dir> in "Using arbitrary Python environments"
1 parent fa34466 commit c8fb12c

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

docs/pip/environments.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ Since uv has no dependency on Python, it can install into virtual environments o
5959
For example, setting `VIRTUAL_ENV=/path/to/venv` will cause uv to install into `/path/to/venv`,
6060
regardless of where uv is installed. Note that if `VIRTUAL_ENV` is set to a directory that is
6161
**not** a [PEP 405 compliant](https://peps.python.org/pep-0405/#specification) virtual environment,
62-
it will be ignored.
63-
64-
uv can also install into arbitrary, even non-virtual environments, with the `--python` argument
65-
provided to `uv pip sync` or `uv pip install`. For example,
66-
`uv pip install --python /path/to/python` will install into the environment linked to the
67-
`/path/to/python` interpreter.
62+
it will be ignored. The path to the virtual environment can also be provided with the `--python`
63+
option, e.g., `uv pip install --python /path/to/venv ...`.
64+
65+
uv can also install into arbitrary, even non-virtual environments, with the `--python` option. For
66+
example, `uv pip install --python /path/to/python` will install into the environment linked to the
67+
`/path/to/python` interpreter regardless of whether or not it is a virtual environment. As with
68+
virtual environments, the provided path can be the root directory of an environment instead of the
69+
Python executable itself.
6870

6971
For convenience, `uv pip install --system` will install into the system Python environment. Using
7072
`--system` is roughly equivalent to `uv pip install --python $(which python)`, but note that

0 commit comments

Comments
 (0)