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.

Ipywidgets and JupyterLab

See original GitHub issue

I have seen a few other people complain about this issue, but I am having trouble getting ipywidgets to work with JupyterLab. I setup a conda environment and installed jupyter lab, and various other extensions. I made sure to follow https://github.com/jupyter-widgets/ipywidgets/tree/master/packages/jupyterlab-manager#version-compatibility to stay compatible. I have jupyterlab 0.35.4, and jupyterlab-manager 0.38.1.

Related issues?

Here is the error from the chrome inspector:

Error displaying widget
vendors~main.97aacf046fa0e7539513.js:1081304 Module @jupyter-widgets/base, semver range ^1.2.0 is not registered as a widget module

Here are the versions of jupyterlab, ipywidgets and the manager extension:

(jupyter_shared) /work$ conda list -e | grep ipy
WARNING: The conda.compat module is deprecated and will be removed in a future release.
ipydatawidgets=4.0.0=py_0
ipykernel=5.1.1=py37h24bf2e0_0
ipyleaflet=0.11.0=py37_0
ipympl=0.2.1=py37_1002
ipyscales=0.3.0=py_0
ipython=7.6.0=py37h5ca1d4c_0
ipython_genutils=0.2.0=py_1
ipyvolume=0.5.1=py37_1001
ipywebrtc=0.4.3=py37_1000
ipywidgets=7.5.0=py_0
scipy=1.3.0=py37h921218d_0

(jupyter_shared) /work$ jupyter lab  --version
0.35.4

(jupyter_shared) /work$ jupyter lab notebook --version
0.35.4

(jupyter_shared) /work$ jupyter labextension list
JupyterLab v0.35.4
Known labextensions:
   app dir: /work/anaconda3/envs/jupyter_shared/share/jupyter/lab
        @jupyter-widgets/jupyterlab-manager v0.38.1  enabled  OK
        @jupyter-widgets/jupyterlab-sidecar v0.3.0  enabled  OK
...

Another thing I did was install the kernel-spy extension to take a view of the kernel messages and this came back in one of the JSON messages under iopub.content.traceback:

"KeyError Traceback (most recent call last)"
"/work/anaconda3/envs/jupyter_shared/lib/python3.7/site-packages/ipywidgets/widgets/widget.py in _handle_msg(self, msg)  
"""Called when a msg is received from the front-end"""  
data = msg['content']['data'] 
--> method = data['method'] 

"KeyError: 'method'

Please let me know if there is anything else I can put in this ticket to help solve this.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
jtlz2commented, Feb 6, 2020

Does anyone have any idea of the next highest combination of version numbers that works?

I’d like to take advantage of the latest jupyterlab/widget updates e.g. fileupload etc.

Can anyone raise @hainm’s excellent combination of

pythonversion=3.7
labversion=0.34.12
labmanagerversion=0.37.4
ipywidgetsversion=7.4.2

?

2reactions
hainmcommented, Jul 9, 2019

I am not sure if this’s helpful, but I have below recipe that works for a while (not sure about “now”)

pythonversion=3.7
labversion=0.34.12
labmanagerversion=0.37.4
ipywidgetsversion=7.4.2

conda create -n lab python=$pythonversion -y
source activate lab
conda install ipywidgets=$ipywidgetsversion -c conda-forge -y
conda install jupyterlab=$labversion  -y -c conda-forge
jupyter-labextension install @jupyter-widgets/jupyterlab-manager@$labmanagerversion

I think the idea is to make very simple setup work first and then gradually adding more extensions until it breaks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation — Jupyter Widgets 7.7.2 documentation
Most of the time, installing ipywidgets automatically configures JupyterLab 3.0 to use widgets. The ipywidgets package does this by depending on the ...
Read more >
How to get ipywidgets working in Jupyter Lab? - Stack Overflow
JupyterLab now prefers a model where arbitrary javascript is no longer allowed to be embedded in a cell's output, which is how many ......
Read more >
Jupyter Widgets JupyterLab Extension - PyPI
A JupyterLab 3.0 extension for Jupyter/IPython widgets. Installation. To enable ipywidgets support in JupyterLab 3.x: pip install jupyterlab_widgets. Version ...
Read more >
"pip install ipywidgets==7.7 jupyterlab" leads to unusable ...
I need an environment with Jupyterlab and ipywidgets 7.7 (8.0 will not work). Installing both with pip leads to a non working ipywidget...
Read more >
Jupyter Notebook - IPyWidgets - Tutorialspoint
IPyWidgets is a Python library of HTML interactive widgets for Jupyter notebook. Each UI element in the library can respond to events and...
Read more >

github_iconTop Related Medium Post

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