matplotlib / ipympl

Matplotlib Jupyter Integration
https://matplotlib.org/ipympl/
BSD 3-Clause "New" or "Revised" License
1.59k stars 225 forks source link

Failed to load model class 'MPLCanvasModel' from module 'jupyter-matplotlib' Error: No version of module jupyter-matplotlib is registered. #538

Closed ashixu closed 9 months ago

ashixu commented 11 months ago

Describe the issue

when i am plotting in the jupyterlab, it seems something wrong... (Google Chrome) cf93bc314d50fd1238969d5f89b5a15

Versions

C:\Users\10158>python -c "import sys; print('\n',sys.version); import ipympl; print('ipympl version:', ipympl.__version__)" && jupyter --version && jupyter nbextension list && jupyter labextension list

 3.11.5 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:26:23) [MSC v.1916 64 bit (AMD64)]
ipympl version: 0.9.3
Selected Jupyter core packages...
IPython          : 8.15.0
ipykernel        : 6.25.0
ipywidgets       : 8.0.4
jupyter_client   : 7.4.9
jupyter_core     : 5.3.0
jupyter_server   : 1.23.4
jupyterlab       : 3.6.3
nbclient         : 0.5.13
nbconvert        : 6.5.4
nbformat         : 5.9.2
notebook         : 6.5.4
qtconsole        : 5.4.2
traitlets        : 5.7.1
Known nbextensions:
  config dir: D:\anaconda\etc\jupyter\nbconfig
    notebook section
      jupyter-matplotlib/extension enabled
      - Validating: ok
      jupyterlab-plotly/extension enabled
      - Validating: ok
      jupyter-js-widgets/extension enabled
      - Validating: ok
JupyterLab v3.6.3
D:\anaconda\share\jupyter\labextensions
        jupyter-matplotlib v0.11.3 enabled ok
        jupyterlab-plotly v5.9.0 enabled ok
        @jupyter-widgets/jupyterlab-manager v5.0.9 enabled ok (python, jupyterlab_widgets)
        @pyviz/jupyterlab_pyviz v2.3.0 enabled ok (python, pyviz_comms)

Other labextensions (built into JupyterLab)
   app dir: D:\anaconda\share\jupyter\lab
        @krassowski/jupyterlab-lsp v3.10.2 enabled ok
heydaridlm commented 10 months ago

Ditto, I am also having this issue.

matteobachetti commented 9 months ago

Same here

martinRenou commented 9 months ago

Can you try from a clean environment without jupyterlab-plotly and @pyviz/jupyterlab_pyviz ?

matteobachetti commented 9 months ago

@martinRenou so, it worked after I uninstalled both jupyter and ipympl, and reinstalled from pip. For reference, I'm using notebook 7, not jupyterlab.

martinRenou commented 9 months ago

Thanks for confirming.

Can you try from a clean environment without jupyterlab-plotly and @pyviz/jupyterlab_pyviz ?

I'm asking about this because some extensions that are not updated to support ipywidgets 8 may break ipympl, I've seen this before.

Reinstalling can sometimes help.

martinRenou commented 9 months ago

Closing for triaging. If you see this issue, please open your own issue providing your installation information, it's always helpful.

Thank you!