Skip to content

Commit 2dfeafb

Browse files
Set UV_PYTHON in Jupyter kernels (astral-sh#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 astral-sh#11154.
1 parent b0e9781 commit 2dfeafb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/guides/integration/jupyter.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ $ uv add --dev ipykernel
5151
Then, you can create the kernel for `project` with:
5252

5353
```console
54-
$ uv run ipython kernel install --user --name=project
54+
$ uv run ipython kernel install --user --env VIRTUAL_ENV $(pwd)/.venv --name=project
5555
```
5656

5757
From there, start the server with:

0 commit comments

Comments
 (0)