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.
Further note: switching to the classic notebook interface works in that a slider is shown for:
import ipywidgets
ipywidgets.IntSlider()
This same cell breaks, as per above, in the JupyterLab interface.
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.
I have similar issue.
import ipywidgets
ipywidgets.IntSlider()
results in a
Error displaying widget
message. The browser console log contains this error:
Module @jupyter-widgets/base, semver range ^1.2.0 is not registered as a widget module default.js:132
Error displaying widget renderer.js:45
Module @jupyter-widgets/base, semver range ^1.2.0 is not registered as a widget module renderer.js:46
Error displaying widget renderer.js:45
Module @jupyter-widgets/base, semver range ^1.2.0 is not registered as a widget module
My env is (note that I am using pipenv and not conda to install packages)
python --version
Python 3.6.7
pipenv graph | grep ipyw
ipywidgets [required: >=7.0.0a8, installed: 7.5.0]
jupyter lab --version
0.35.6
jupyter labextension list
JupyterLab v0.35.6
Known labextensions:
app dir: /home/xxxx/.local/share/virtualenvs/apiclient-xx/share/jupyter/lab
@jupyter-widgets/jupyterlab-manager v0.38.1 enabled OK
bqplot v0.4.6 enabled OK
jupyter-leaflet v0.11.1 enabled OK
Thanks for raising this.
There were lots of compatibility issues between ipywidgets and JupyterLab in the lead-up to JupyterLab 1.x release.
This now refers to an outdated version of JupyterLab and of @jupyter-widgets/jupyterlab-manager. Feel free to re-open if you're still having issues with JupyterLab 1.x.
@pbugnion I'm still having an issue with this and no answer I have found here or on stackoverflow etc. resolves it.
jupyterlab 1.2.6
ipywidgets 7.5.1
Any ideas?
Thanks
@hainm Finally!! Thank you so so much!
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
?
Most helpful comment
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
?