{"id":730,"library":"widgetsnbextension","title":"Jupyter Notebook Widgets Frontend Extension","description":"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.","status":"active","version":"4.0.15","language":"python","source_language":"en","source_url":"https://pypi.org/project/widgetsnbextension/","tags":["jupyter","widgets","notebook","frontend","ipywidgets","interactive"],"install":[{"cmd":"pip install widgetsnbextension","lang":"bash","label":"Using pip"},{"cmd":"conda install widgetsnbextension","lang":"bash","label":"Using Conda"}],"dependencies":[{"reason":"Provides the Python backend for interactive widgets that this extension renders in the classic Jupyter Notebook.","package":"ipywidgets","optional":false},{"reason":"Runtime environment.","package":"python","optional":false}],"imports":[{"note":"widgetsnbextension provides the frontend component; ipywidgets provides the Python API for creating widgets.","wrong":"from widgetsnbextension import IntSlider","symbol":"IntSlider","correct":"from ipywidgets import IntSlider"},{"note":"Widgets are displayed using IPython's display framework or implicitly when an ipywidget object is the last expression in a cell.","wrong":"import widgetsnbextension","symbol":"display","correct":"from IPython.display import display"}],"quickstart":{"code":"from ipywidgets import IntSlider, display\nimport time\n\nslider = IntSlider(value=0, min=0, max=10, step=1, description='Value:')\ndisplay(slider)\n\ndef on_value_change(change):\n    print(f\"Slider value changed to: {change.new}\")\n\nslider.observe(on_value_change, names='value')","lang":"python","description":"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."},"warnings":[{"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.","message":"Widgets 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"The `jupyter nbextension enable` command might be deprecated or not found in newer Jupyter installations, especially with JupyterLab 3.0+ or Notebook 7+.","severity":"breaking","affected_versions":"JupyterLab 3.0+ and Jupyter Notebook 7+"},{"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.","message":"Version mismatches between `ipywidgets` and `widgetsnbextension` can lead to unexpected behavior or failure to render widgets.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"Intermittent failures to render saved widget states, leading to 'Error displaying widget: model not found' when reopening a notebook.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"Custom Jupyter extensions or server configurations can sometimes conflict with `ipywidgets`' communication channels, preventing widgets from functioning correctly.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"`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.","severity":"breaking","affected_versions":"All versions"},{"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.","message":"The `ipywidgets` Python package is not installed, leading to a `ModuleNotFoundError` when attempting to import it.","severity":"breaking","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-05-12T18:21:01.457Z","next_check":"2026-06-26T00:00:00.000Z","problems":[],"ecosystem":"pypi","meta_description":null,"install_score":0,"install_tag":"stale","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":"4.0.15","install_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"22.2M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":1.6,"import_time_s":null,"mem_mb":null,"disk_size":"23M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"24.0M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":1.7,"import_time_s":null,"mem_mb":null,"disk_size":"24M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"15.9M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":1.6,"import_time_s":null,"mem_mb":null,"disk_size":"16M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"15.6M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":1.6,"import_time_s":null,"mem_mb":null,"disk_size":"16M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"21.7M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":1.9,"import_time_s":null,"mem_mb":null,"disk_size":"22M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]},"quickstart_checks":{"last_tested":"2026-04-24","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}