Skip to content
Latchkey

papermill "Could not find kernel" in CI

papermill starts a kernel using the notebook's recorded kernelspec, or the one you pass with -k/--kernel. If that kernelspec is not registered on the runner, papermill cannot launch it and fails before executing cells.

What this error means

papermill fails with "jupyter_client.kernelspec.NoSuchKernel: No such kernel named X" or a message that it could not find the kernel, and jupyter kernelspec list lacks that name.

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

Common causes

ipykernel not installed on the runner

No Python kernelspec is registered because ipykernel was never installed, so the requested kernel does not exist.

The notebook records a kernel name CI does not have

The saved kernelspec name (for example a conda env name) is not present in the CI environment.

How to fix it

Register the kernel and pass it explicitly

  1. Install ipykernel into the active interpreter.
  2. Register it as a named kernel.
  3. Run papermill with -k set to that name.
Terminal
python -m pip install ipykernel
python -m ipykernel install --user --name ci-kernel
papermill input.ipynb output.ipynb -k ci-kernel

List available kernels to confirm the name

Verify the kernel exists before running so the name in -k matches a registered kernelspec.

Terminal
jupyter kernelspec list

How to prevent it

  • Install ipykernel and register a known kernel name in CI.
  • Pass -k to papermill instead of relying on the saved kernel name.
  • Verify with jupyter kernelspec list in the setup step.

Frequently asked questions

What causes ""Could not find kernel""?
No Python kernelspec is registered because ipykernel was never installed, so the requested kernel does not exist.
How do I fix "Could not find kernel"?
Register the kernel and pass it explicitly

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card