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.

%matplotlib widget not working in jupyter lab

See original GitHub issue

Running a cell in jupyter lab with %matplotlib widget results in:

Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous … Running the cell more than once results in:

KeyError: '97acd0c8fb504a2288834b349003b4ae'

My environment:

  • Python 3.6.8
  • Matplotlib 3.0.3

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

53reactions
hasibzunaircommented, Oct 28, 2019

Just pip install ipympl.

It works now after running the following bash commands.

conda install -y nodejs
pip install --upgrade jupyterlab
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyter-matplotlib
jupyter nbextension enable --py widgetsnbextension

Edit: Must restart jupyter server after running these commands

8reactions
Nestak2commented, Jan 18, 2020

Thanks, “restart” was the critical instruction for me. It wasn’t enough the quit and start again jupyterlab in the terminal, only after restarting the computer the plots finally worked

Read more comments on GitHub >

github_iconTop Results From Across the Web

matplotlib - Widget and graph don't show up in Jupyter lab ...
1.) Make sure that you have Jupyter Lab version > 1.0 and ipywidgets > 7.5 installed, as adviced here. Just type in a...
Read more >
Matplotlib display problems in Jupyter | by Paddy Harrison
If you encounter matplotlib display problems in Jupyter lab or notebooks, this may be due to environment package errors if you are using ......
Read more >
ipympl
ipympl enables using the interactive features of matplotlib in Jupyter Notebooks, Jupyter Lab, Google Colab, VSCode notebooks, Google Colab.
Read more >
Ipywidgets with matplotlib
To run the notebook locally, the very first requirement is a working Jupyter environment. Setting up an installation lies outside the scope ...
Read more >
Jupyter Lab ipywidgets no longer work with ipympl?
My widgets all become non-functional. I can operate and interact with them, but the figures they control do not change at all. ·...
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