From 5ecfc3d900b58a3a3b48d05968090667c6ba753b Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Tue, 21 Jan 2025 19:40:01 +0100 Subject: [PATCH] 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 --- docs/concepts/projects/config.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/concepts/projects/config.md b/docs/concepts/projects/config.md index 74455c0d4..39bbf9213 100644 --- a/docs/concepts/projects/config.md +++ b/docs/concepts/projects/config.md @@ -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