Skip to content

fix: reset example notebook kernelspec to python3 - #1254

Open
kylebarron wants to merge 1 commit into
mainfrom
fix/notebook-kernelspec
Open

fix: reset example notebook kernelspec to python3#1254
kylebarron wants to merge 1 commit into
mainfrom
fix/notebook-kernelspec

Conversation

@kylebarron

Copy link
Copy Markdown
Member

Jupyter records the last kernel that ran a notebook in its metadata, so saving from a locally-registered kernel (e.g. one pointing at this repo's .venv) persists that kernel's name into the committed file.

JupyterLab resolves that saved name against the full kernel search path, and the user-level kernel directory stays on that path even though juv run prepends its ephemeral environment via JUPYTER_PATH. A notebook stamped with a machine-specific kernel therefore executes in that kernel's environment rather than the one juv run built from the notebook's PEP 723 metadata, and its declared dependencies appear to be missing.

Reset the 18 affected notebooks to the generic python3 kernelspec, whose argv is a bare python and so inherits whichever environment launched Jupyter. Add a pre-commit hook so a future save can't reintroduce it.

Jupyter records the last kernel that ran a notebook in its metadata, so
saving from a locally-registered kernel (e.g. one pointing at this repo's
.venv) persists that kernel's name into the committed file.

JupyterLab resolves that saved name against the full kernel search path,
and the user-level kernel directory stays on that path even though `juv
run` prepends its ephemeral environment via JUPYTER_PATH. A notebook
stamped with a machine-specific kernel therefore executes in that kernel's
environment rather than the one `juv run` built from the notebook's PEP
723 metadata, and its declared dependencies appear to be missing.

Reset the 18 affected notebooks to the generic `python3` kernelspec, whose
argv is a bare `python` and so inherits whichever environment launched
Jupyter. Add a pre-commit hook so a future save can't reintroduce it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ds-release-bot ds-release-bot Bot added the fix label Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant