Registry / web-framework / widgetsnbextension

widgetsnbextension

JSON →
library4.0.16pypypi✓ verified 26d ago

widgetsnbextension is a Python package that provides the essential JavaScript frontend components, enabling Jupyter interactive widgets (ipywidgets) to function within the classic Jupyter Notebook environment. It acts as a bridge, allowing Python widget objects in the kernel to be rendered and interact with the user interface. The library, currently at version 4.0.15 (released November 1, 2025), is an integral part of the broader Jupyter Widgets ecosystem, maintaining an active release cadence alongside ipywidgets and Jupyter itself.

pip install widgetsnbextension
INSTALL
IMPORT
SIG · WIDGETSNBEXTENSION
W
widgetsnbextension
web-frameworkpythonv4.0.16
Install
1.7s avg
Import
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.0.16 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 22.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.000s · 23MB
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

warn
from widgetsnbextension import warn
from ipywidgets import IntSlider

This quickstart demonstrates how to create and display a simple interactive integer slider using `ipywidgets`. While `widgetsnbextension` is the underlying component enabling this in the classic Notebook, the user-facing interaction is primarily through the `ipywidgets` library. The `display` function is used to render the widget, and an observer is attached to react to value changes.

from ipywidgets import IntSlider, display import time slider = IntSlider(value=0, min=0, max=10, step=1, description='Value:') display(slider) def on_value_change(change): print(f"Slider value changed to: {change.new}") slider.observe(on_value_change, names='value')
Debug
Known issues
gotchaWidgets may not render, showing a text representation (e.g., `IntSlider(value=0)`) instead of the interactive component. This typically indicates that the JavaScript frontend extension is either not properly installed or enabled for your Jupyter environment.
fix
Ensure `widgetsnbextension` is installed and enabled for classic Jupyter Notebook (`jupyter nbextension enable --py widgetsnbextension --sys-prefix`). For JupyterLab, install `@jupyter-widgets/jupyterlab-manager` (`jupyter labextension install @jupyter-widgets/jupyterlab-manager`). Restart your Jupyter server after installation/enabling.
affects: All versions
breakingThe `jupyter nbextension enable` command might be deprecated or not found in newer Jupyter installations, especially with JupyterLab 3.0+ or Notebook 7+.
fix
For JupyterLab 3.0+, `ipywidgets` version 7.6.0 and later automatically enable support without manual `jupyter labextension install` if installed with pip/conda. If issues persist, refer to the `ipywidgets` documentation for the latest installation steps specific to your Jupyter version.
affects: JupyterLab 3.0+ and Jupyter Notebook 7+
gotchaVersion mismatches between `ipywidgets` and `widgetsnbextension` can lead to unexpected behavior or failure to render widgets.
fix
Always install `ipywidgets` and `widgetsnbextension` (and `jupyterlab_widgets` for JupyterLab) from the same source (e.g., all from PyPI, or all from conda-forge) and ideally upgrade them together to compatible versions. Pip's dependency resolution usually handles this, but manual intervention might be needed for complex environments.
affects: All versions
gotchaIntermittent failures to render saved widget states, leading to 'Error displaying widget: model not found' when reopening a notebook.
fix
This can sometimes be related to underlying server or file system issues, especially in shared environments. Ensure your Jupyter server environment is stable and check for any disk-related errors if the problem persists across multiple notebooks. Saving widget state automatically might exacerbate issues with unstable storage.
affects: All versions
gotchaCustom Jupyter extensions or server configurations can sometimes conflict with `ipywidgets`' communication channels, preventing widgets from functioning correctly.
fix
If you are developing or using other Jupyter extensions, test `ipywidgets` in a clean environment first. Review your custom extension's interaction with kernel communication, specifically `Comm` channels, as conflicts can arise if multiple extensions attempt to manage them simultaneously.
affects: All versions
breaking`ipywidgets` module not found, leading to `ModuleNotFoundError`. This indicates that the `ipywidgets` package is not installed in the Python environment where the script is being executed.
fix
Install `ipywidgets` using pip (`pip install ipywidgets`) or conda (`conda install -c conda-forge ipywidgets`). Ensure the installation is performed in the correct Python environment associated with your Jupyter server or script execution.
affects: All versions
breakingThe `ipywidgets` Python package is not installed, leading to a `ModuleNotFoundError` when attempting to import it.
fix
Install the `ipywidgets` package using pip (`pip install ipywidgets`) or conda (`conda install -c conda-forge ipywidgets`). Ensure your Python environment is correctly activated before installation.
affects: All versions
Upgrade
Version history
4.0.16latest on PyPI · released Aug 18, 2026
Audit
Dependencies
ipywidgetsrequiredProvides the Python backend for interactive widgets that this extension renders in the classic Jupyter Notebook.
pythonrequiredRuntime environment.
Agent activity
23 hits · last 30 days
node
18
OpenAI (training)
1
Resources
widgetsnbextension — pip install widgetsnbextension · libregistry