question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error displaying widget: model not found

See original GitHub issue

Describe the issue

%matplotlib widget
import matplotlib.pyplot as plt

plt.plot([0,1],[0,1])

results in

Error displaying widget: model not found

The javascript console shows:

Could not instantiate widget
Error: Could not create a model.
Uncaught (in promise) Error: Module jupyter-matplotlib, semver range ^0.10.5 is not registered as a widget module

Versions

 3.9.12 (main, Mar 26 2022, 15:44:31) 
[Clang 13.1.6 (clang-1316.0.21.2)]
ipympl version: 0.8.8
Selected Jupyter core packages...
IPython          : 8.2.0
ipykernel        : 6.12.1
ipywidgets       : 7.7.0
jupyter_client   : 7.2.1
jupyter_core     : 4.9.2
jupyter_server   : 1.16.0
jupyterlab       : 3.3.2
nbclient         : 0.5.13
nbconvert        : 6.4.5
nbformat         : 5.3.0
notebook         : 6.4.10
qtconsole        : not installed
traitlets        : 5.1.1
Known nbextensions:
  config dir: /Users/remco/.jupyter/nbconfig
    notebook section
      toggle_all_line_numbers/main  enabled 
      - Validating: OK
      equation-numbering/main  enabled 
      - Validating: OK
      toc2/main  enabled 
      - Validating: OK
      collapsible_headings/main disabled
      nbextensions_configurator/config_menu/main  enabled 
      - Validating: problems found:
        - require?  X nbextensions_configurator/config_menu/main
      scroll_down/main  enabled 
      - Validating: OK
      jupyter-js-widgets/extension  enabled 
      - Validating: OK
      contrib_nbextensions_help_item/main  enabled 
      - Validating: OK
    tree section
      nbextensions_configurator/tree_tab/main  enabled 
      - Validating: problems found:
        - require?  X nbextensions_configurator/tree_tab/main
  config dir: /usr/local/etc/jupyter/nbconfig
    notebook section
      jupyter-matplotlib/extension  enabled 
      - Validating: OK
      jupyter-js-widgets/extension  enabled 
      - Validating: OK
JupyterLab v3.3.2
/usr/local/share/jupyter/labextensions
        jupyter-matplotlib v0.10.1 enabled OK
        @jupyter-widgets/jupyterlab-manager v3.0.1 enabled OK (python, jupyterlab_widgets)

Other labextensions (built into JupyterLab)
   app dir: /opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/share/jupyter/lab


The following source extensions are overshadowed by older prebuilt extensions:
    jupyter-matplotlib

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
recmocommented, Apr 10, 2022

Ok, this worked:

❯ rm -r /usr/local/share/jupyter/labextensions/jupyter-matplotlib
❯ jupyter labextension uninstall jupyter-matplotlib       
Uninstalling jupyter-matplotlib from /opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/share/jupyter/lab/extensions
Building jupyterlab assets (production, minimized)
❯ jupyter labextension uninstall jupyter-matplotlib
No labextension named "jupyter-matplotlib" installed
❯ jupyter labextension list
JupyterLab v3.3.2
/usr/local/share/jupyter/labextensions
        @jupyter-widgets/jupyterlab-manager v3.0.1 enabled OK (python, jupyterlab_widgets)

But I’m still getting the same error.

0reactions
martinRenoucommented, Dec 22, 2022

Do you have an error in the JavaScript console?

Oh I see it. jupyter-webrtc could be the culprit. I would suggest creating a new environment without ipywebrtc which does not support ipywidgets 8. If you really want ipywebrtc, you could downgrade to ipywidgets 7.

Read more comments on GitHub >

github_iconTop Results From Across the Web

“Error displaying widget: model not found” with Jupyter lab #112
I followed your installation instructions on a fresh python and jupyter setup with pip but end up with “Error displaying widget: model not...
Read more >
Error displaying widget; model not found: 5 Fixes
In this article, we're talking about the “Error displaying widget: model not found” problem when using Jupyter Labs in Python.
Read more >
Jupyter-matplotlib: Error displaying widget: model not found
Solved! Turned out ipywidget 7.5 breaks jupyter lab and it isaffecting other libraries too. https://github.com/plotly/plotly.py/issues/1659.
Read more >
Error displaying widget: model not found -- how to fix this?
'Error displaying widget: model not found'. I tryed in jupyterlab2.x. It works. Does anyone knows how to fixed this problem.It will be very ......
Read more >
Issue with stackview inside JupyterLab - "Error displaying widget
I installed stackview from cmd and restarting everything did not help. The code itself is rather short: from skimage.io import imread import ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found