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.
jupyter_client.kernelspec.NoSuchKernel: No such kernel named python3Common 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
- Install ipykernel into the active interpreter.
- Register it as a named kernel.
- Run papermill with
-kset to that name.
python -m pip install ipykernel
python -m ipykernel install --user --name ci-kernel
papermill input.ipynb output.ipynb -k ci-kernelList available kernels to confirm the name
Verify the kernel exists before running so the name in -k matches a registered kernelspec.
jupyter kernelspec listHow to prevent it
- Install ipykernel and register a known kernel name in CI.
- Pass
-kto papermill instead of relying on the saved kernel name. - Verify with
jupyter kernelspec listin the setup step.