3

I want to use the pre-release Jupyter Lab version 1.0+. I have a Pipfile that looks like this:

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[packages]
ipywidgets = "*"
jupyterlab = ">=1.0.0a0"
...

[requires]
python_version = "3.7"

[pipenv]
allow_prereleases = true

which installs the following versions:

  • jupyterlab==1.0.0rc0
  • ipywidgets==7.4.2
  • notebook==5.7.8
  • widgetsnbextension==3.4.2

I then run the command jupyter labextension install @jupyter-widgets/jupyterlab-manager. It installs the labextension:

  • @jupyter-widgets/jupyterlab-manager v0.39.1.

I can't get the widgets to appear in the notebook.

enter image description here

I know it can cause problems to have mismatched Jupyter Lab & Jupyter Widgets versions. Is there a version of Jupyter Widgets compatible with version 1.0 of Jupyter Lab?

Dustin Michels
  • 2,951
  • 2
  • 19
  • 31

1 Answers1

0

This is fairly old but I came across this as I had a similar problem myself using AWS SageMaker which is currently still pinned to version 1 of jupyter lab.

I was able to recreate your problem more or less and I think there's two separate issues here:

  1. Your requirements have conflicting tornado dependencies. I wasn't even able to execute any cells and would instead get an error in the console like AttributeError: 'WebSocketProtocol13' object has no attribute 'is_closing'. Running pip-compile from pip-tools on the requirements revealed the incompatible tornado versions. This can be fixed by changing your version of jupyter lab, I figure there must have been an issue with that version being the first patch of a major version. Since you have a requirement for it to be 1.0.*, upgrading to 1.0.10 fixed the issue for me.

  2. However the second issue is your version of jupyterlab-manager rather than ipywidgets. Compatible versions corresponding to different versions of jupyter lab are listed here. In your case, you must install v1.0. I'm not sure why v0.39.1 is being installed but you can set this like jupyter labextension install @jupyter-widgets/jupyterlab-manager@1.0.

Doing both of those allows ipywidgets widgets to render properly.

amin_nejad
  • 989
  • 10
  • 22