ipympl: notebook backend not working in jupyterlab
I just installed this on top of my standard env, using conda-forge.
Using standard %matplotlib nbagg
as activation command and using standard mpl plotting did not pop up any figure inside a jupyterlab notebook?
Using MPL 2.0 and jupyterlab v0.16 on a Python 3.5 env with conda on OSX 10.11.6 inside Safari 10.0.3
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 51 (22 by maintainers)
In case others get here and are a little confused: At the beginning of your notebook, run
%matplotlib ipympl
, not%matplotlib notebook/nbagg
.For installation You need to install node.js. In the terminal, run
This is now working (shown with pinned versions so this will always work):
Hi, any news about this issue?
ipympl
is also available via conda, using the conda-forge channel.You’ll need to use the current prerelease of jupyterlab
pip install jupyterlab --pre
, or you’ll need to install the previous release of the widget manager:jupyter labextension install @jupyter-widgets/jupyterlab-manager@0.31
.Ok, apparently
npm
must be installed too. I saw the statement thatnodejs
is required, but on Ubuntu installingnodejs
does not automatically installnpm
.Confirmed that it is still broken in the latest release, 0.21.0. Will try to look at this with @tacaswell next week.
Try
-c conda-forge
instead of-c conda forge
still not working (ipywidgets 6.0.0, matplotlib 2.0.2, jupyter lab: 0.25.2, Python 3.5.3). It would be appreciated to use nbagg in jupyter lab.
All you need to enable this is to import ipympl.
Oh, good catch!
Worked for me:
Then use
%matplotlib widget
in notebook.PS : or maybe it was
conda install -c defaults -c conda-forge ...
@johnmarktaylor91 You need to update
ipykernel
/ipython
to a version that is aware of ipympl.You can also monkey patch in the right information.
Use the current prerelease of jupyterlab worked for me! Thanks @jasongrout.
Looking again at the above - I realised I might not have the latest version of Jupyter Lab. So I ran
conda install -c conda-forge jupyterlab
which upgraded Jupyter Lab to 0.31.0
Starting Jupyter Lab then asked for a rebuild - which I did. During the rebuild the following appeared in the bash script:
After reloading the Jupyter Lab page, the
%matplotlib ipympl
instruction triggered the same error traceback as in my original post above.Great! Closing again, then.
@blink1073, thanks for the info! Knowing it works for you made me re-test with a clean, just-created conda env, and it’s now fine.
I was testing in an env I’d made exclusively to track jlab, but where I’ve upgraded jlab multiple times along the way. There must have been stale JS somewhere…
This points out the fact that right now, the upgrade process is still a bit rough: even though I’m isolating jlab into its own env with basically everything from conda and only lab and its dependencies being pulled in manually (plus plugins like this one), every now and then something will break in somewhat hard-to-diagnose ways.
Not complaining at all, just noting that fact so we’re aware of it (or at least I keep it more in mind 😃
We may want to remind that anyone having weird errors along the way, just nuke even their whole env and make it fresh. It’s a bit brutal as a solution, but honestly it’s a lot easier than tracking down where the problem may be coming from (and with good reproducibility habits, it’s actually pretty painless to nuke/recreate a known env).
Thanks again much!! When the install/upgrade path for this gets smoother, it’s going to be awesome for end users, in lab included.