-
Create a virtual environment called, e.g.,
my-env
:$ uv venv my-env
-
Install
ipykernel
into it:$ uv pip install -p my-env ipykernel
-
Register the kernel so it will show up in Jupyter:
$ uv run -p my-env -m ipykernel install --user --name my-env
-
Run Jupyter from anywhere:
$ uvx jupyter lab
-
Install packages into the
my-env
virtual environment as required, and they'll turn up in your notebooks:$ uv pip install -p my-env pandas
uv init my-project
cd my-project
uv run --with jupyter jupyter lab
- Inside a cell,
!uv add numpy
, or, at the command line inside themy-project
directory:uv add numpy