nbconvert "No such kernel named python3" in CI
Every notebook records the kernel name it wants to run with. nbconvert looks that name up in the installed kernelspecs, and if no kernel by that name is registered, jupyter_client raises NoSuchKernel before any cell runs.
What this error means
jupyter nbconvert --execute fails immediately with "jupyter_client.kernelspec.NoSuchKernel: No such kernel named python3" and jupyter kernelspec list shows no python3 entry.
jupyter_client.kernelspec.NoSuchKernel: No such kernel named python3Common causes
ipykernel is not installed, so no python3 kernelspec exists
Installing jupyter/nbconvert alone does not register a Python kernel; without ipykernel there is no python3 kernelspec for the notebook to use.
The kernel was registered under a different name
The runner has a kernel named, for example, ci-kernel, but the notebook requests python3, so the lookup fails.
How to fix it
Install ipykernel to register python3
Installing ipykernel and running its install command creates the python3 kernelspec the notebook expects.
python -m pip install ipykernel
python -m ipykernel install --user --name python3Override the kernel name at convert time
Force nbconvert to use a kernel that is actually registered instead of the notebook's saved name.
jupyter nbconvert --to notebook --execute \
--ExecutePreprocessor.kernel_name=python3 notebook.ipynbHow to prevent it
- Install ipykernel in CI so a python3 kernelspec exists.
- Pass
--ExecutePreprocessor.kernel_nameso the run does not depend on the saved name. - Verify with
jupyter kernelspec listbefore executing notebooks.