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" using Jupyter Lab 1.0.2

See original GitHub issue

Possibly related to #124, I am trying to run a super simple example after following the installation instructions:

pip install ipympl

# If using JupyterLab
# Install nodejs: https://nodejs.org/en/download/
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyter-matplotlib

nodejs info:

$ node -v
v10.16.0
$ npm version
{ npm: '6.9.0',
...
}

Jupyter info:

$ jupyter --version
jupyter core     : 4.5.0
jupyter-notebook : 6.0.0
qtconsole        : not installed
ipython          : 7.6.1
ipykernel        : 5.1.1
jupyter client   : 5.3.1
jupyter lab      : 1.0.2
nbconvert        : 5.5.0
ipywidgets       : 7.5.0
nbformat         : 4.4.0
traitlets        : 4.3.2

Simple example:

# Enabling the `widget` backend.
# This requires jupyter-matplotlib a.k.a. ipympl.
# ipympl can be install via pip or conda.
%matplotlib widget
# aka import ipympl
 
import matplotlib.pyplot as plt
 
plt.plot([0, 1, 2, 2])
plt.show()

Error:

Error displaying widget

Not sure what else I need, or where a version mismatch is, any help is appreciated. Thank you!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
marcel-goldschen-ohmcommented, Jan 3, 2020

The above worked for me with one addition (note that I did not do this in a new fresh environment). I ended up running $ jupyter lab build before everything worked.

Also a note to others that may be getting tripped up with this. I previously thought I had the latest ipympl because conda update ipympl said it was already up to date. However, the version was < 0.4.0 because it was not from the conda-forge channel. Make sure to check the version number as @davidfokkema mentioned above.

Finally, I’m sure everyone agrees, but this really needs to be made much more seamless. Without nice plots jupyterlab is pretty lacking.

7reactions
davidfokkemacommented, Dec 20, 2019

I could get it only to work using ipympl 0.4.0 and jupyter-matplotlib 0.5.0. Curiously, updating ipympl actually downgraded my jupyter-matplotlib extension and I had to run labextension update TWICE to get it from 0.4.0 -> 0.4.1 -> 0.5.0. Strange. So, this worked for me (starting from a previous installation):

$ conda install ipympl=0.4.0
$ jupyter labextension update --all
$ jupyter labextension update --all
$ jupyter labextension list
JupyterLab v1.2.4
Known labextensions:
   app dir: /Users/david/anaconda3/envs/labplot/share/jupyter/lab
        @jupyter-widgets/jupyterlab-manager v1.1.0  enabled  OK
        jupyter-matplotlib v0.5.0  enabled  OK

Since ipympl 0.4.0 is in conda-forge, a minimal fresh installation can be (currently) created with:

$ conda create -n labplot -c conda-forge python=3 jupyterlab ipympl nodejs
$ conda activate labplot
$ jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlib
$ jupyter labextension update --all
Read more comments on GitHub >

github_iconTop Results From Across the Web

'Error displaying widget' on jupyterlab using jupyterhub
I am getting the "Error displaying widget" error as shown in screenshot below. The error in chrome Javascript console is as shown below....
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?
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 >
Issue with stackview inside JupyterLab - "Error displaying widget
Hi, i just wanted to test the really cool stackview package inside a juypter notebook but encountered a problem which I could solve...
Read more >
Installation — Jupyter Widgets 7.7.2 documentation
It may mean the widget JavaScript is still loading. If the message persists in the Jupyter Notebook or JupyterLab, it likely means that...
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