Skip to content
Latchkey

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.

nbconvert
jupyter_client.kernelspec.NoSuchKernel: No such kernel named python3

Common 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.

Terminal
python -m pip install ipykernel
python -m ipykernel install --user --name python3

Override the kernel name at convert time

Force nbconvert to use a kernel that is actually registered instead of the notebook's saved name.

Terminal
jupyter nbconvert --to notebook --execute \
  --ExecutePreprocessor.kernel_name=python3 notebook.ipynb

How to prevent it

  • Install ipykernel in CI so a python3 kernelspec exists.
  • Pass --ExecutePreprocessor.kernel_name so the run does not depend on the saved name.
  • Verify with jupyter kernelspec list before executing notebooks.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →