From 2dfeafbaa43e768304eae36a520c4f9cda7134f6 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sat, 1 Feb 2025 16:54:34 -0500 Subject: [PATCH] Set `UV_PYTHON` in Jupyter kernels (#11155) ## Summary It turns out activating the kernel does not change `VIRTUAL_ENV`, so we still install into the environment the Jupyter environment, rather than the project environment. Unfortunately, after this change, we do still show a warning on `uv add`: ``` warning: `VIRTUAL_ENV=/Users/crmarsh/.cache/uv/archive-v0/3bddKDdYXuX2w57Fu6itL` does not match the project environment path `.venv` and will be ignored ``` `uv pip install` works without warning. Closes #11154. --- docs/guides/integration/jupyter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/integration/jupyter.md b/docs/guides/integration/jupyter.md index a81890287..af883cd5e 100644 --- a/docs/guides/integration/jupyter.md +++ b/docs/guides/integration/jupyter.md @@ -51,7 +51,7 @@ $ uv add --dev ipykernel Then, you can create the kernel for `project` with: ```console -$ uv run ipython kernel install --user --name=project +$ uv run ipython kernel install --user --env VIRTUAL_ENV $(pwd)/.venv --name=project ``` From there, start the server with: