Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ipywidgets and JupyterLab #2488

Closed
jquacinella opened this issue Jul 8, 2019 · 7 comments
Closed

Ipywidgets and JupyterLab #2488

jquacinella opened this issue Jul 8, 2019 · 7 comments
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.

Comments

@jquacinella
Copy link

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.

@jquacinella
Copy link
Author

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.

@hainm
Copy link

hainm commented 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.

@dazzag24
Copy link

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

@pbugnion
Copy link
Member

pbugnion commented Jan 8, 2020

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 pbugnion closed this as completed Jan 8, 2020
@jtlz2
Copy link

jtlz2 commented Feb 3, 2020

@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

@jtlz2
Copy link

jtlz2 commented Feb 4, 2020

@hainm Finally!! Thank you so so much!

@jtlz2
Copy link

jtlz2 commented 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

?

@lock lock bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label May 20, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

No branches or pull requests

5 participants