Troubleshooting
Jupyter kernel terminated
Recover from Jupyter kernels that crash, restart, or fail to start.
What this warning means
A Jupyter kernel is the process that runs the code cells in a notebook. A "kernel terminated" warning means that process exited unexpectedly, was killed, or failed to start. The notebook file usually remains intact, but variables, imports, open files, and in-memory results from that kernel are gone.
Possible causes include:
- The project ran out of memory.
- The kernel crashed due to native code, compiled packages, or a bad extension.
- The selected custom kernel points at a missing or broken Python environment.
- The project restarted while the notebook was running.
- Startup code or package imports failed before the kernel became ready.
First recovery steps
- Save the notebook.
- Restart the kernel from the notebook Kernel menu.
- Run a small cell such as
1 + 1before rerunning expensive cells. - If the kernel immediately dies again, try a different kernel or open a terminal to inspect the environment.
- Check project memory if the failure happened while loading data, training a model, plotting a large result, or importing a heavy package.
If the notebook had long-running work, inspect saved files and outputs before rerunning everything. The kernel restart clears memory, but files written to the project filesystem remain available.
Diagnose memory pressure
Memory pressure can cause sudden kernel termination. Check memory use alongside the kernel's error message; termination alone does not establish the cause. The project memory limit is shared by notebooks, terminals, language servers, web apps, and agents in the project.
See Low memory and out-of-memory crashes for ways to reduce memory use, stop other processes, checkpoint work, or move the project to a host with more RAM.
Diagnose custom kernels
If only one custom kernel fails, the kernelspec or virtual environment is probably broken. Open a terminal and check:
jupyter kernelspec list
python -m ipykernel --version
For uv-managed environments, make sure the kernelspec points at the Python
inside the virtual environment and that ipykernel is installed there. See
Custom Jupyter kernels with uv.
Prevent repeat failures
Write long computations so they can restart from durable files. Save intermediate data, avoid keeping duplicate large objects in memory, and test custom kernels with a small notebook before using them for a class or research workflow.