Quick answer: A Jupyter widget model-not-found error usually means the Python widget package and the browser-side widget manager are not aligned. Check the kernel environment, ipywidgets and jupyterlab-widgets versions, the JupyterLab extension, and the browser console as separate layers. Reinstalling one package without identifying the layer can leave the mismatch unchanged.

The Jupyter message Error displaying widget: model not found appears when the browser frontend tries to render a widget but cannot find the matching widget model state. In practice, this usually means the notebook output is stale, the kernel was restarted, the widget package is missing from the active environment, or the frontend extension that renders widgets is not available.
This is an ipywidgets and notebook-state problem, not a general GUI toolkit error. PyQt, Tkinter, and desktop widgets use different rendering systems. In Jupyter, a widget has a Python-side object in the kernel and a matching JavaScript-side model in the notebook page. If either side is missing or out of sync, the frontend can show the model-not-found message.
The most useful references are the ipywidgets installation guide, widget basics documentation, Output widget documentation, JupyterLab extensions guide, JupyterLab notebook guide, and IPython display documentation.
Check Installed Widget Packages
First confirm which packages are installed in the same Python environment as the notebook kernel. Running this in the notebook is more reliable than checking a separate terminal that may point at another environment.
import importlib.metadata as metadata
packages = ["ipywidgets", "ipykernel", "jupyterlab", "notebook", "widgetsnbextension"]
for package in packages:
try:
version = metadata.version(package)
except metadata.PackageNotFoundError:
version = "not installed"
print(f"{package}: {version}")
If ipywidgets is missing, install it for the active kernel environment. If the widget package exists but the frontend is old, update JupyterLab or Notebook as well so the browser can render current widget models.
Run A Minimal Widget Test
A small slider is the fastest way to test whether widget display works at all. If this fails in a clean cell, fix installation and extension support before debugging a larger notebook.
import ipywidgets as widgets
from IPython.display import display
slider = widgets.IntSlider(value=3, min=0, max=10, description="Count")
display(slider)
If the slider renders, the basic widget channel is healthy. If an older notebook still fails, clear its saved output and rerun the cells that create widgets.
Clear Stale Notebook Output
Saved output can reference widget models that belonged to a previous kernel session. Clearing output and recreating widgets from code gives the frontend fresh state.
import ipywidgets as widgets
from IPython.display import clear_output, display
clear_output(wait=True)
display(widgets.IntProgress(value=2, min=0, max=5, description="Ready"))
After clearing output, restart the kernel and run the notebook from the top. Do not rely on a widget object that was created before the restart.
Build Widgets In Functions
Reusable notebooks are easier to recover when every widget can be rebuilt from code. Wrap widget creation in a small function instead of depending on old output already stored in the notebook file.
import ipywidgets as widgets
from IPython.display import display
def build_progress(value=0):
return widgets.IntProgress(value=value, min=0, max=10, description="Progress")
display(build_progress(4))
This pattern makes reruns predictable. A fresh kernel can rebuild the display from the saved source cells without needing browser state from a prior session.
Test Output Widgets
Some notebooks fail only when output is routed through an interactive widget area. A small Output widget checks that the output channel is working.
import ipywidgets as widgets
from IPython.display import display
output = widgets.Output()
with output:
print("Widget output channel works")
display(output)
If normal sliders render but output widgets fail, update ipywidgets and the frontend together. Version mismatches can affect one widget type before another.
Prefer Simple Status Widgets
For progress updates, keep the widget simple and recreate it when the notebook runs. This avoids stale saved models and keeps the browser workload small.
import ipywidgets as widgets
from IPython.display import display
items = ["load", "clean", "plot"]
status = widgets.Label(value="Ready")
display(status)
for index, item in enumerate(items, start=1):
status.value = f"{index}/{len(items)} {item}"
For long loops, combine simple widgets with periodic output cleanup. If the notebook prints thousands of lines while also updating widgets, the browser can become slow or lose track of state.
Also separate widget display failures from calculation failures. If the same cell both computes results and renders controls, split it into two cells while debugging. Run the calculation first, confirm the plain Python result, and then render the widget from that known result. This makes it clear whether the problem is package setup, stale output, or the code that prepares the data.
Fix Checklist
First, clear widget output, restart the kernel, and rerun the notebook from the first cell. This removes references to models created in an older session.
Next, verify that ipywidgets is installed in the active kernel and that the Jupyter frontend is modern enough to render it. Hosted notebooks may manage the frontend for you, so follow the provider’s supported widget setup path.
Finally, replace saved interactive output with code that rebuilds widgets each run. When a notebook is shared, the recipient should be able to open it, install the required packages, run the cells, and see fresh widgets without relying on stale embedded state.
Confirm The Failing Kernel
A notebook server can offer several kernels, and the terminal that launches Jupyter may not be the interpreter selected by the notebook. Print the executable and package location from a cell, then compare it with the environment where you run pip or conda.
import sys
import ipywidgets
print(sys.executable)
print(ipywidgets.__file__)
print(ipywidgets.__version__)
Align Python And Frontend Packages
ipywidgets supplies the Python-side widget objects while a frontend manager and jupyterlab-widgets provide browser-side support. The compatible installation path depends on the JupyterLab or Notebook version. Upgrade or pin the related packages together, then restart the server and kernel rather than only rerunning the cell.
# Run in the same environment as the selected kernel.
import subprocess
import sys
subprocess.run([sys.executable, "-m", "pip", "show", "ipywidgets", "jupyterlab-widgets"], check=False)
Use A Minimal Widget Smoke Test
Test one standard widget before loading a complex extension. If the Python repr appears but the browser does not render the control, the model was created but the frontend manager is not loading it. Look at the browser console and JupyterLab extension list for the first missing asset or version mismatch.
import ipywidgets as widgets
slider = widgets.IntSlider(description="value", min=0, max=10, value=3)
slider
Clear Stale State Safely
Close affected notebooks, restart the kernel and server, and refresh the browser only after package changes. A long-running Jupyter process can keep old extension assets or kernels alive. Avoid deleting caches blindly; record versions first so a working environment can be reproduced if the problem returns.
from pathlib import Path
import sys
print("kernel:", sys.executable)
print("cwd:", Path.cwd())
print("restart the kernel and Jupyter frontend after dependency changes")
The ipywidgets documentation covers widget installation and frontend integration. Treat the kernel, Python packages, Jupyter frontend, and browser assets as one compatibility matrix rather than assuming the error is caused by notebook code.
For related Jupyter frontend failures, compare IProgress and ipywidgets setup, browser-side IPython errors, and Jupyter output limits when isolating kernel and extension layers.
Frequently Asked Questions
What causes error displaying widget model not found?
The notebook created a widget model that the active frontend cannot load, often because ipywidgets, jupyterlab-widgets, the JupyterLab manager, or the kernel environments are mismatched.
How do I check whether ipywidgets is installed?
Run the package inspection and a small import in the same environment as the notebook kernel, then check the frontend extension or widget manager version separately.
Why does the widget work in one notebook but not another?
The notebooks may use different kernels, JupyterLab versions, frontend extensions, or cached assets even on the same computer.
Will reinstalling ipywidgets always fix the model error?
No. Reinstalling only one layer can deepen a version mismatch; inspect the kernel, frontend manager, package versions, and browser console first.