How to troubleshoot common Jupyter Notebook errors

Jupyter Notebook · Debugging · Approx. 10 min read

Jupyter Notebook errors often show up at the worst time: right before a deadline or demo. Instead of random trial and error, use a simple checklist to debug the most common issues: imports, file paths, and kernels.

1. Start with three questions

  1. Did this notebook ever work on this machine?
  2. Did I change environment, data, or code since then?
  3. Can I reproduce the error in a minimal example?

2. ModuleNotFoundError (imports)

Typical causes:

Basic fix inside a cell:

import sys
!{sys.executable} -m pip install package-name

Then restart the kernel and rerun imports.

3. FileNotFoundError (paths)

Checklist:

4. Kernel issues (can’t start, crashes, or “dead”)

Try:

5. Protect yourself with reproducible snapshots

The best time to create a snapshot is right after you get a notebook working. NoteCapsule helps you do that with a single call:

from notebookcapsule import create_capsule

create_capsule(
    name="known-good-state",
    notebook_path="notebook.ipynb",
    data_dirs=["./data"],
    base_dir=".",  # project root
)

The Capsule contains a copy of the notebook, an environment snapshot, a data manifest, and metadata – a solid starting point if something breaks later.

Minimal Jupyter troubleshooting checklist

  • ✅ Confirm which Python interpreter Jupyter uses.
  • ✅ Install missing packages in that interpreter.
  • ✅ Print working directory and adjust relative paths.
  • ✅ Restart kernel after big changes.
  • ✅ Keep a NoteCapsule Capsule for each major milestone.

Turn “it broke” into “I can roll back”

NoteCapsule gives you reproducible checkpoints of working Jupyter Notebook states, so debugging doesn’t mean rewriting hours of code from memory.

Join NoteCapsule early access