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

Error: Module @jupyter-widgets/base, semver range ^2.0.0 is not registered as a widget module when using Voila #3588

Closed
pswdemcon opened this issue Sep 12, 2022 · 3 comments

Comments

@pswdemcon
Copy link

I ran into some problems using ipywidgets and voila when I upgraded to ipywidgets 8.0.2. Effectively I no longer see any of the widgets, e.g. buttons when deploying with Voila. When opening the development console in Edge I notice a series of errors, complaining about non registered versions (Error: Module @jupyter-widgets/base, semver range ^2.0.0 is not registered as a widget module).

I do see widgets when I use a notebook instead.

When I downgrade ipywidgets to version 7.7.1 instead, I do get working widgets when using Voila. E.g. changing the pyproject.toml file and running poetry update works.

I am using poetry to set up the Python environment (3.10.2 on Windows 10) using the following configuration:

[tool.poetry.dependencies]
python = "^3.10"
ipywidgets = "8.0.2"   # or 7.7.1
voila = "^0.3.6"

pip list with ipywidgets version 8.0.2 installed

Package              Version
-------------------- -----------
anyio                3.6.1
argon2-cffi          21.3.0
argon2-cffi-bindings 21.2.0
asttokens            2.0.8
attrs                22.1.0
Babel                2.10.3
backcall             0.2.0
beautifulsoup4       4.11.1
bleach               5.0.1
certifi              2022.6.15.1
cffi                 1.15.1
charset-normalizer   2.1.1
colorama             0.4.5
debugpy              1.6.3
decorator            5.1.1
defusedxml           0.7.1
entrypoints          0.4
executing            1.0.0
fastjsonschema       2.16.1
idna                 3.3
ipykernel            6.15.2
ipython              8.5.0
ipywidgets           8.0.2
jedi                 0.18.1
Jinja2               3.1.2
json5                0.9.10
jsonschema           4.16.0
jupyter_client       7.3.5
jupyter-core         4.11.1
jupyter-server       1.18.1
jupyterlab-pygments  0.2.2
jupyterlab_server    2.15.1
jupyterlab-widgets   3.0.3
lxml                 4.9.1
MarkupSafe           2.1.1
matplotlib-inline    0.1.6
mistune              0.8.4
nbclient             0.5.13
nbconvert            6.5.3
nbformat             5.4.0
nest-asyncio         1.5.5
packaging            21.3
pandocfilters        1.5.0
parso                0.8.3
pickleshare          0.7.5
pip                  22.2.2
prometheus-client    0.14.1
prompt-toolkit       3.0.31
psutil               5.9.2
pure-eval            0.2.2
pycparser            2.21
Pygments             2.13.0
pyparsing            3.0.9
pyrsistent           0.18.1
python-dateutil      2.8.2
pytz                 2022.2.1
pywin32              304
pywinpty             2.0.7
pyzmq                23.2.1
requests             2.28.1
Send2Trash           1.8.0
setuptools           65.3.0
six                  1.16.0
sniffio              1.3.0
soupsieve            2.3.2.post1
stack-data           0.5.0
terminado            0.15.0
tinycss2             1.1.1
tornado              6.2
traitlets            5.4.0
urllib3              1.26.12
voila                0.3.6
wcwidth              0.2.5
webencodings         0.5.1
websocket-client     1.4.1
websockets           10.3
wheel                0.37.1
widgetsnbextension   4.0.3

The notebook I use to test is very simple, and run the notebook using voila NOTEBOOKNAME.ipynb. For the 7.7.1 version I see a button and for 8.0.2 I do not.

import ipywidgets as widgets
from IPython.display import display

b = widgets.Button(description="Go!")

display(b)
@afonit
Copy link

afonit commented Sep 14, 2022

@pswdemcon,
it is my understanding that voila does not yet support ipywidgets 8, I have seen a few approaches explored on their github, please refer to this issue which has the most recent comments:
voila-dashboards/voila#1188

@yiliang114
Copy link

export const JUPYTER_WIDGETS_VERSION = '2.0.0';

The version number that appears in the error report comes from here. Should not write dead 2.0.0 actually should read the version in package.json?

@martinRenou
Copy link
Member

This issue is not relevant anymore as latest Voila now supports ipywidgets 8.x. Closing as fixed.

  • Voila 0.3.x supports ipywidgets 7 only
  • Voila 0.4.5 supports ipywidgets 7 and ipywidgets 8
  • Voila 0.5.x supports ipywigdgets 8 only

@yiliang114 if you're having troubles, please open your own issue on the voila repository specifying your case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants