Commit 4ac44a9
committed
fix: Install kernel spec into venv instead of user directory (#29)
* fix: Install kernel spec into venv instead of user directory
Previously, ipykernel specs were installed with --user flag, placing them
in ~/Library/Jupyter/kernels/. This caused the Deepnote Jupyter server to
fall back to generic Python kernels because it couldn't discover the
venv-specific kernel spec.
This resulted in a mismatch where:
- Shell commands (!pip install) used the venv's Python (via PATH)
- But the kernel interpreter used system Python
- Leading to ModuleNotFoundError for packages installed in the venv
Now installing kernel specs with --prefix into the venv itself at
<venv>/share/jupyter/kernels/. Jupyter automatically discovers kernel
specs in this location when started with the venv's Python, ensuring
the correct interpreter is used.
Each .deepnote file maintains its own isolated venv with its own kernel
spec, preventing conflicts when multiple notebooks are open.1 parent 37c8c01 commit 4ac44a9
File tree
2 files changed
+14
-2
lines changed- src/kernels/deepnote
2 files changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| |||
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
| 215 | + | |
213 | 216 | | |
214 | 217 | | |
215 | 218 | | |
| |||
219 | 222 | | |
220 | 223 | | |
221 | 224 | | |
222 | | - | |
| 225 | + | |
| 226 | + | |
223 | 227 | | |
224 | 228 | | |
225 | 229 | | |
226 | 230 | | |
227 | 231 | | |
228 | 232 | | |
229 | 233 | | |
230 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
231 | 242 | | |
232 | 243 | | |
233 | 244 | | |
| |||
0 commit comments