mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Update docs on how to use UV_PROJECT_ENVIRONMENT
to use the system python environment (#10817)
## Summary The docs did mention that you could set the `UV_PROJECT_ENVIRONMENT` variable to point Uv to use the system Python environment (e.g. for use in CI or Docker), but it did not document _how_. Reference: https://github.com/astral-sh/uv/pull/6834#issuecomment-2319253359 --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
parent
399086d28f
commit
5ecfc3d900
1 changed files with 10 additions and 0 deletions
|
@ -172,6 +172,16 @@ This option can be used to write to the system Python environment, though it is
|
|||
`uv sync` will remove extraneous packages from the environment by default and, as such, may leave
|
||||
the system in a broken state.
|
||||
|
||||
To target the system environment, set `UV_PROJECT_ENVIRONMENT` to the prefix of the Python
|
||||
installation. For example, on Debian-based systems, this is usually `/usr/local`:
|
||||
|
||||
```console
|
||||
$ python -c "import sysconfig; print(sysconfig.get_config_var('prefix'))"
|
||||
/usr/local
|
||||
```
|
||||
|
||||
To target this environment, you'd export `UV_PROJECT_ENVIRONMENT=/usr/local`.
|
||||
|
||||
!!! important
|
||||
|
||||
If an absolute path is provided and the setting is used across multiple projects, the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue