Skip to content

Commit

Permalink
Update docs on how to use UV_PROJECT_ENVIRONMENT to use the system …
Browse files Browse the repository at this point in the history
…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:
#6834 (comment)

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
  • Loading branch information
NiklasRosenstein and zanieb authored Jan 21, 2025
1 parent 399086d commit 5ecfc3d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/concepts/projects/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5ecfc3d

Please sign in to comment.