Failed to load model class 'MPLCanvasModel' from module 'jupyter-matplotlib'
See original GitHub issueDescribe the issue
This example plot is failing:
%matplotlib ipympl
import matplotlib.pyplot as plt
import numpy as np
fig, ax = plt.subplots()
x = np.linspace(0, 2*np.pi, 100)
y = np.sin(3*x)
ax.plot(x, y)
[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'MPLCanvasModel' from module 'jupyter-matplotlib'
Error: No version of module jupyter-matplotlib is registered
at WidgetManager.loadClass (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/lib_index_js.c47facf974cffc1de06d.js:942:19)
at WidgetManager.loadModelClass (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/packages_base-manager_lib_index_js.dcca134bd5d3eec26948.js:819:34)
at WidgetManager._make_model (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/packages_base-manager_lib_index_js.dcca134bd5d3eec26948.js:651:36)
at WidgetManager.new_model (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/packages_base-manager_lib_index_js.dcca134bd5d3eec26948.js:495:35)
at WidgetManager.handle_comm_open (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/packages_base-manager_lib_index_js.dcca134bd5d3eec26948.js:405:21)
at LabWidgetManager._handleCommOpen (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/lib_index_js.c47facf974cffc1de06d.js:815:24)
at b._handleCommOpen (http://localhost:8888/static/lab/jlab_core.3ff62e44d3544d23c59e.js?v=3ff62e44d3544d23c59e:2:925131)
at async b._handleMessage (http://localhost:8888/static/lab/jlab_core.3ff62e44d3544d23c59e.js?v=3ff62e44d3544d23c59e:2:927121)
Versions
3.8.5 (default, Sep 4 2020, 02:22:02)
[Clang 10.0.0 ]
ipympl version: 0.8.8
Selected Jupyter core packages...
IPython : 7.28.0
ipykernel : 6.4.1
ipywidgets : 8.0.0rc0
jupyter_client : 7.0.6
jupyter_core : 4.8.1
jupyter_server : 1.11.1
jupyterlab : 3.1.18
nbclient : 0.5.4
nbconvert : 6.2.0
nbformat : 5.1.3
notebook : 6.4.4
qtconsole : not installed
traitlets : 5.1.0
Known nbextensions:
config dir: /Users/davidlaxer/.jupyter/nbconfig
notebook section
jupyter-js-widgets/extension enabled
- Validating: OK
bqplot/extension enabled
- Validating: OK
config dir: /Users/davidlaxer/tensorflow-metal/etc/jupyter/nbconfig
notebook section
catboost-widget/extension enabled
- Validating: OK
jupyter-matplotlib/extension enabled
- Validating: OK
jupyterlab-plotly/extension enabled
- Validating: OK
jupyter-js-widgets/extension enabled
- Validating: OK
JupyterLab v3.1.18
/Users/davidlaxer/tensorflow-metal/share/jupyter/labextensions
@jupyter-widgets/jupyterlab-manager v5.0.0-rc.0 enabled OK
Other labextensions (built into JupyterLab)
app dir: /Users/davidlaxer/tensorflow-metal/share/jupyter/lab
jupyter-matplotlib v0.11.0 enabled OK
jupyterlab-plotly v5.7.0 enabled OK
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:24 (4 by maintainers)
Top Results From Across the Web
Jupyter Lab issue displaying widgets (javascript error)
I checked that jupyter-widgets is enable with jupyter labextension list. ... message] Failed to load model class 'CheckboxModel' from module ...
Read more >ipympl - Matplotlib
ipympl enables using the interactive features of matplotlib in Jupyter Notebooks, Jupyter Lab, Google Colab, VSCode notebooks, Google Colab.
Read more >Error displaying widget: model not found -- how to fix this?
So as to use Stacked, I installed version 8: > pip uninstall ipywidgets > pip install ipywidgets==8.0.0b But upon displaying a Stacked ...
Read more >Using Matplotlib with Jupyter Notebook - GeeksforGeeks
The Jupyter Notebook is an open-source web application that allows you to create and share documents that ... importing matplotlib module.
Read more >Error fixed - "matplotlib.pyplot" not resolved from source. in ...
Hello Friends, In this tutorial session we will see the quick fix of the common error that comes when we work with Jupyter...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am experiencing a very similar issue: In a new environment with
ipympl==0.9.2
,ipywidgets==8.0.2
initially the matplotlib figure is displayed correctly in Jupyterlab with the minimal example:A different extension needed an update though and that triggered a Jupyterlab build. After the build finished without errors the same example only yields the error message in the cell output:
This seems to indicate that something is still not working in the built process. This reminds me of similar issues in the past where in a new environment everything worked but for unclear reasons after an update it became impossible to recover.
A workaround seems to be the complete cycle of
conda uninstall jupyterlab ipympl
,conda install -c conda-forge jupyterlab ipympl
. Just reinstalling ipympl is not enough.I’m still experiencing this issue with ipywidgets 8.0.1 and ipympl 0.9.2, which is the latest release and includes gh-461. Should I open a new one, or continue the conversation here?
This uses
jupyterlab-widgets==3.0.2
on the JupyterLab environment (we have 2 separate environments because we’re using https://github.com/jupyter-server/enterprise_gateway/).