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.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user