You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _sources/guides/environment_setup.md.txt
+28Lines changed: 28 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,34 @@ uv run python my_script.py
88
88
uv run jupyter lab
89
89
```
90
90
91
+
### Registering the environment as a Jupyter kernel
92
+
93
+
uv does not automatically register your virtual environment as a Jupyter kernel. This is by design — uv manages only the environment itself, not the kernel registry that Jupyter uses to discover Python environments. As a result, even after running `uv sync`, your environment will not appear in JupyterLab's kernel picker until you register it manually.
94
+
95
+
To register it, first make sure `ipykernel` is installed in the environment, then use it to add the kernel to Jupyter's registry:
96
+
97
+
```bash
98
+
uv add ipykernel
99
+
uv run python -m ipykernel install --user --name my-experiment --display-name "My Experiment"
100
+
```
101
+
102
+
- `--name` is a short identifier used internally (no spaces).
103
+
- `--display-name` is what appears in the JupyterLab UI.
104
+
105
+
After running this, restart JupyterLab and the kernel will be available in the launcher and the kernel picker.
<h3>Registering the environment as a Jupyter kernel<aclass="headerlink" href="#registering-the-environment-as-a-jupyter-kernel" title="Link to this heading">#</a></h3>
521
+
<p>uv does not automatically register your virtual environment as a Jupyter kernel. This is by design — uv manages only the environment itself, not the kernel registry that Jupyter uses to discover Python environments. As a result, even after running <codeclass="docutils literal notranslate"><spanclass="pre">uv</span><spanclass="pre">sync</span></code>, your environment will not appear in JupyterLab’s kernel picker until you register it manually.</p>
522
+
<p>To register it, first make sure <codeclass="docutils literal notranslate"><spanclass="pre">ipykernel</span></code> is installed in the environment, then use it to add the kernel to Jupyter’s registry:</p>
<liclass="toc-h3 nav-item toc-entry"><aclass="reference internal nav-link" href="#creating-and-syncing-the-environment">Creating and syncing the environment</a></li>
681
703
<liclass="toc-h3 nav-item toc-entry"><aclass="reference internal nav-link" href="#activating-the-environment">Activating the environment</a></li>
704
+
<liclass="toc-h3 nav-item toc-entry"><aclass="reference internal nav-link" href="#registering-the-environment-as-a-jupyter-kernel">Registering the environment as a Jupyter kernel</a></li>
682
705
<liclass="toc-h3 nav-item toc-entry"><aclass="reference internal nav-link" href="#adding-new-dependencies">Adding new dependencies</a></li>
0 commit comments