20

I'm trying to install jupyter-matplotlib extension but can't make it work in a jupyterlab instance. Once installed by following the steps here:
https://github.com/matplotlib/jupyter-matplotlib
I get the error when executing a simple example:
Error displaying widget: model not found
screen capture of described behaviour

Here's the output of my $ conda list for relevant packages:

ipykernel 5.1.1
ipympl 0.2.1
ipython 7.6.1
ipython_genutils 0.2.0
ipywidgets 7.5.0
jupyter_client 5.3.1
jupyter_core 4.4.0
jupyterlab 1.0.2
jupyterlab_server 1.0.0

Akshat Zala
  • 710
  • 1
  • 8
  • 23
Mario Viti
  • 496
  • 1
  • 5
  • 10

3 Answers3

8

Solved! Turned out ipywidget 7.5 breaks jupyter lab and it isaffecting other libraries too.

https://github.com/plotly/plotly.py/issues/1659

downgrading to 7 solved the issue for me (allthough 7 wrt 7.5 should be backward compatibile)!

Also be sure to match ipympl 0.2.1 with jupyter-matplotlib 0.3.0 labextension. jupyter labextension install jupyter-matplotlib@0.3.0

Mario Viti
  • 496
  • 1
  • 5
  • 10
5

First you need to install:

 pip install ipywidgets

 conda install -c conda-forge ipympl

Then check if the following is OK:

!jupyter labextension list

You should see something like this:

JupyterLab v3.0.14
/home/jovyan/.local/share/jupyter/labextensions
    jupyter-leaflet v0.15.0 enabled OK
    jupyterlab-plotly v5.1.0 enabled OK
    @jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets)

The most important part is here:

Restart your jupyter notebook.

Paul
  • 1,801
  • 1
  • 12
  • 18
1

I also got the same error message when i first installed ipympl but it got solved automatically when I restarted the Jupyter lab.