voila-dashboards / voila

Voilà turns Jupyter notebooks into standalone web applications
https://voila.readthedocs.io
Other
5.46k stars 504 forks source link

Voila not rendering ipywidgets (Javascript error) #1271

Open patrickhoebeke opened 1 year ago

patrickhoebeke commented 1 year ago

Description

With a fresh install of jupyterlab and voilà, the ipywidgets are not rendered while they are correctly displayed by jupyterlab.

image

After clicking on it: image

Reproduce

Step1 : install environment

In a terminal

pip install jupyterlab ipywidgets voila

Step2 : create the following notebook "issue.ipynb" containing the following code:

from ipywidgets import Button
Button(description="button 1")

In a terminal

voila issue.ipynb

Open the result in your browser at http://localhost:8866/

image

As it works perfectly in jupyterlab (no error in the browser console), I suspect a problem with voila or related libraries.

The complete javascript error message is :

Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'ButtonModel' from module '@jupyter-widgets/controls'
loadClass@http://localhost:8866/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:458:117211
loadClass@http://localhost:8866/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:472:57590
loadModelClass@http://localhost:8866/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:458:114981
_make_model@http://localhost:8866/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:458:111788
new_model@http://localhost:8866/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:458:109385
_loadFromKernel/<@http://localhost:8866/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:458:110659
_loadFromKernel@http://localhost:8866/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:458:110549

I don't know if it is related but I noticed an error code 101 in the network connections (using Web Developer Tools from Firefox): image

I also noticed the following error in the console log of FireFox image

From my experience, from this last info, it is likely due to a problem of compatibility of versions of different modules. Honestly I am a little bit lost with the ipywidgets ecosystem and I did several trial downgrading some packages without success. I would be very happy if someone could help.

Expected behavior

I expect the button to be rendered :-) such as image

Context

Installed versions: jupyterlab==3.5.1 ipywidgets==7.7.2 voila==0.4.0

Jupyter labextension list: JupyterLab v3.5.1 /home/user/.virtualenvs/jupyterlab3/share/jupyter/labextensions jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments) @jupyter-widgets/jupyterlab-manager v3.1.1 enabled OK (python, jupyterlab_widgets) @voila-dashboards/jupyterlab-preview v2.2.0 enabled OK (python, voila)

OS version: 20.04.4 LTS (Focal Fossa)

Browser Same issue on Firefox 107.0.1 (64-bits) and Chrome 107.0.5304.123

Note: As you may notice from the info below, I am running all this in Ubuntu running using WSL and virtualenvwrapper but I feel that it has no impact on the problem as I had the same issue running the same tests from a Docker container.

Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.

$PATH:
        /home/user/.virtualenvs/jupyterlab3/bin
        /home/linuxbrew/.linuxbrew/bin
        /home/linuxbrew/.linuxbrew/sbin
        /home/user/.local/bin
        /home/user/bin
        /usr/local/sbin
        /usr/local/bin
        /usr/sbin
        /usr/bin
        /sbin
        /bin
        /usr/games
        /usr/local/games
        /usr/lib/wsl/lib
        /mnt/c/Windows/System32
        /mnt/c/Program Files/Docker/Docker/resources/bin
        /mnt/c/ProgramData/DockerDesktop/version-bin
        /mnt/c/Program Files/PowerShell/7/
        /mnt/c/Users/user/AppData/Local/Microsoft/WindowsApps
        /mnt/c/Users/user/go/bin
        /mnt/c/Users/user/AppData/Local/Programs/IPFS Desktop/resources/app.asar.unpacked/src/ipfs-on-path/scripts/bin-win
        /mnt/c/Program Files/7-Zip
        /mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0
        /mnt/c/Users/user/AppData/Local/Programs/Microsoft VS Code/bin
        /snap/bin

sys.path:
        /home/user/.virtualenvs/jupyterlab3/bin
        /usr/lib/python38.zip
        /usr/lib/python3.8
        /usr/lib/python3.8/lib-dynload
        /home/user/.virtualenvs/jupyterlab3/lib/python3.8/site-packages

sys.executable:
        /home/user/.virtualenvs/jupyterlab3/bin/python

sys.version:
        3.8.10 (default, Jun 22 2022, 20:18:18) 
        [GCC 9.4.0]

platform.platform():
        Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29

which -a jupyter:
        /home/user/.virtualenvs/jupyterlab3/bin/jupyter

pip list:
        Package              Version
        -------------------- -----------
        anyio                3.6.2
        argon2-cffi          21.3.0
        argon2-cffi-bindings 21.2.0
        asttokens            2.2.1
        attrs                22.1.0
        Babel                2.11.0
        backcall             0.2.0
        beautifulsoup4       4.11.1
        bleach               5.0.1
        certifi              2022.9.24
        cffi                 1.15.1
        charset-normalizer   2.1.1
        debugpy              1.6.4
        decorator            5.1.1
        defusedxml           0.7.1
        entrypoints          0.4
        executing            1.2.0
        fastjsonschema       2.16.2
        idna                 3.4
        importlib-metadata   5.1.0
        importlib-resources  5.10.1
        ipykernel            6.17.1
        ipython              8.7.0
        ipython-genutils     0.2.0
        ipywidgets           7.7.2
        jedi                 0.18.2
        Jinja2               3.1.2
        json5                0.9.10
        jsonschema           4.17.3
        jupyter_client       7.4.1
        jupyter_core         5.1.0
        jupyter-server       1.23.3
        jupyterlab           3.5.1
        jupyterlab-pygments  0.2.2
        jupyterlab_server    2.16.3
        jupyterlab-widgets   1.1.1
        MarkupSafe           2.1.1
        matplotlib-inline    0.1.6
        mistune              2.0.4
        nbclassic            0.4.8
        nbclient             0.7.2
        nbconvert            7.2.6
        nbformat             5.7.0
        nest-asyncio         1.5.6
        notebook             6.5.2
        notebook_shim        0.2.2
        packaging            21.3
        pandocfilters        1.5.0
        parso                0.8.3
        pexpect              4.8.0
        pickleshare          0.7.5
        pip                  22.3.1
        pkgutil_resolve_name 1.3.10
        platformdirs         2.5.4
        prometheus-client    0.15.0
        prompt-toolkit       3.0.33
        psutil               5.9.4
        ptyprocess           0.7.0
        pure-eval            0.2.2
        pycparser            2.21
        Pygments             2.13.0
        pyparsing            3.0.9
        pyrsistent           0.19.2
        python-dateutil      2.8.2
        pytz                 2022.6
        pyzmq                24.0.1
        requests             2.28.1
        Send2Trash           1.8.0
        setuptools           65.5.1
        six                  1.16.0
        sniffio              1.3.0
        soupsieve            2.3.2.post1
        stack-data           0.6.2
        terminado            0.17.1
        tinycss2             1.2.1
        tomli                2.0.1
        tornado              6.2
        traitlets            5.6.0
        urllib3              1.26.13
        voila                0.4.0
        wcwidth              0.2.5
        webencodings         0.5.1
        websocket-client     1.4.2
        websockets           10.4
        wheel                0.38.4
        widgetsnbextension   3.6.1
        zipp                 3.11.0
Command Line Output
Paste the output from your command line running `voila` here, use `--debug` if possible.
voila --debug ipywidgets_issue.ipynb ``` [Voila] Looking for voila in /etc/jupyter [Voila] Looking for voila in /usr/local/etc/jupyter [Voila] Looking for voila in /home/user/.jupyter [Voila] Looking for voila in /home/user/.virtualenvs/jupyterlab3/etc/jupyter [Voila] using template: lab [Voila] template paths: /home/user/.virtualenvs/jupyterlab3/share/jupyter/voila/templates/lab /home/user/.virtualenvs/jupyterlab3/share/jupyter/nbconvert/templates/lab /home/user/.virtualenvs/jupyterlab3/share/jupyter/voila/templates/base /home/user/.virtualenvs/jupyterlab3/share/jupyter/nbconvert/templates/base /home/user/.virtualenvs/jupyterlab3/share/jupyter /home/user/.virtualenvs/jupyterlab3/share/jupyter/voila/templates /home/user/.virtualenvs/jupyterlab3/share/jupyter/nbconvert/templates /home/user/.local/share/jupyter /home/user/.local/share/jupyter/voila/templates /home/user/.local/share/jupyter/nbconvert/templates /usr/local/share/jupyter /usr/local/share/jupyter/voila/templates /usr/local/share/jupyter/nbconvert/templates /usr/share/jupyter /usr/share/jupyter/voila/templates /usr/share/jupyter/nbconvert/templates [Voila] static paths: /home/user/.virtualenvs/jupyterlab3/share/jupyter/voila/templates/lab/static /home/user/.virtualenvs/jupyterlab3/share/jupyter/nbconvert/templates/lab/static /home/user/.local/share/jupyter/voila/templates/lab/static /home/user/.local/share/jupyter/nbconvert/templates/lab/static /usr/local/share/jupyter/voila/templates/lab/static /usr/local/share/jupyter/nbconvert/templates/lab/static /usr/share/jupyter/voila/templates/lab/static /usr/share/jupyter/nbconvert/templates/lab/static /home/user/.virtualenvs/jupyterlab3/share/jupyter/voila/templates/base/static /home/user/.virtualenvs/jupyterlab3/share/jupyter/nbconvert/templates/base/static /home/user/.local/share/jupyter/voila/templates/base/static /home/user/.local/share/jupyter/nbconvert/templates/base/static /usr/local/share/jupyter/voila/templates/base/static /usr/local/share/jupyter/nbconvert/templates/base/static /usr/share/jupyter/voila/templates/base/static /usr/share/jupyter/nbconvert/templates/base/static [Voila] Using /tmp to store connection files [Voila] Storing connection files in /tmp/voila_bj7m787e. [Voila] Serving static files from /home/user/.virtualenvs/jupyterlab3/lib/python3.8/site-packages/voila/static. [Voila] Voilà is running at: http://localhost:8866/ [Voila] Found kernel python3 in /home/user/.virtualenvs/jupyterlab3/share/jupyter/kernel [Voila] Found kernel jupyterlab3 in /home/user/.local/share/jupyter/kernels [Voila] Found kernel test in /home/user/.local/share/jupyter/kernels [Voila] Found kernel dev in /home/user/.local/share/jupyter/kernels [Voila] Found kernel jupyterlab in /home/user/.local/share/jupyter/kernels [Voila] Found kernel jupyterlab2 in /home/user/.local/share/jupyter/kernels [Voila] Instantiating kernel 'jupyterlab' with kernel provisioner: local-provisioner [Voila] Starting kernel: ['/home/user/.virtualenvs/jupyterlab/bin/python', '-m', 'ipykernel_launcher', '-f', '/tmp/voila_bj7m787e/kernel-eb48a2bb-76ed-47b3-9f53-6181abd3857e.json'] [Voila] Connecting to: tcp://127.0.0.1:56117 [Voila] Connecting to: tcp://127.0.0.1:44209 [Voila] Kernel started: eb48a2bb-76ed-47b3-9f53-6181abd3857e [Voila] Kernel args: {'kernel_name': 'jupyterlab', 'env': {'SHELL': '/bin/bash', 'WSL_DISTRO_NAME': 'Ubuntu-20.04', 'WT_SESSION': 'e305ec09-339c-4e97-bfa7-b4877f1e8e3b', 'LOGNAME': 'user', 'MANPATH': '/home/linuxbrew/.linuxbrew/share/man:', 'VIRTUALENVWRAPPER_VIRTUALENV': '/home/user/.local/bin/virtualenv', 'VIRTUALENVWRAPPER_SCRIPT': '/home/user/.local/bin/virtualenvwrapper.sh', 'HOME': '/home/user', 'LANG': 'C.UTF-8', 'WSL_INTEROP': '/run/WSL/224_interop', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'VIRTUAL_ENV': '/home/user/.virtualenvs/jupyterlab3',, 'VIRTUALENVWRAPPER_WORKON_CD': '1', , 'VIRTUALENVWRAPPER_PYTHON': '/usr/bin/python3', 'INFOPATH': '/home/linuxbrew/.linuxbrew/share/info:', 'WORKON_HOME': '/home/user/.virtualenvs', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'TERM': 'xterm-256color', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'USER': 'user', 'HOMEBREW_CELLAR': '/home/linuxbrew/.linuxbrew/Cellar', 'VIRTUALENVWRAPPER_PROJECT_FILENAME': '.project', 'SHLVL': '1', , 'HOMEBREW_REPOSITORY': '/home/linuxbrew/.linuxbrew/Homebrew', 'PS1': '(jupyterlab3) \\[\\e]0;\\u@\\h: \\w\\a\\]${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ ', 'WSLENV': 'WT_SESSION::WT_PROFILE_ID', 'XDG_DATA_DIRS': '/usr/local/share:/usr/share:/var/lib/snapd/desktop', 'BROWSER': '/mnt/c/Program Files/Mozilla Firefox/firefox.exe', 'PATH': '/home/user/.virtualenvs/jupyterlab3/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/user/.local/bin:/home/user/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/System32:/mnt/c/Program Files/remoteit/resources/x64:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/c/Program Files/PowerShell/7/:/mnt/c/Users/user/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/user/go/bin:/mnt/c/Users/user/AppData/Local/Programs/IPFS Desktop/resources/app.asar.unpacked/src/ipfs-on-path/scripts/bin-win:/mnt/c/Program Files/7-Zip:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0:/mnt/c/Users/user/AppData/Local/Programs/Microsoft VS Code/bin:/snap/bin', 'VIRTUALENVWRAPPER_HOOK_DIR': '/home/user/.virtualenvs', , 'HOSTTYPE': 'x86_64', 'WT_PROFILE_ID': '******', 'OLDPWD': ******, '_': '/home/user/.virtualenvs/jupyterlab3/bin/voila', : '/', : '', : '', : 'voila/0.4.0', : 'HTTP/1.1', : '8866', : 'localhost', : 'False', : '/', : '/'}, 'cwd': '***'} [Voila] Template paths: /home/user/.virtualenvs/jupyterlab3/share/jupyter/voila/templates/lab /home/user/.virtualenvs/jupyterlab3/share/jupyter/nbconvert/templates/lab /home/user/.virtualenvs/jupyterlab3/share/jupyter/voila/templates/base /home/user/.virtualenvs/jupyterlab3/share/jupyter/nbconvert/templates/base /home/user/.virtualenvs/jupyterlab3/share/jupyter /home/user/.virtualenvs/jupyterlab3/share/jupyter/voila/templates /home/user/.virtualenvs/jupyterlab3/share/jupyter/nbconvert/templates /home/user/.local/share/jupyter /home/user/.local/share/jupyter/voila/templates /home/user/.local/share/jupyter/nbconvert/templates /usr/local/share/jupyter /usr/local/share/jupyter/voila/templates /usr/local/share/jupyter/nbconvert/templates /usr/share/jupyter /usr/share/jupyter/voila/templates /usr/share/jupyter/nbconvert/templates [Voila] Applying preprocessor: TagRemovePreprocessor [Voila] Applying preprocessor: RegexRemovePreprocessor [Voila] Applying preprocessor: coalesce_streams [Voila] Applying preprocessor: HighlightMagicsPreprocessor [Voila] Applying preprocessor: CSSHTMLHeaderPreprocessor [Voila] Attempting to load template index.html.j2 [Voila] template_paths: /home/user/.virtualenvs/jupyterlab3/share/jupyter/voila/templates/lab:/home/user/.virtualenvs/jupyterlab3/share/jupyter/nbconvert/templates/lab:/home/user/.virtualenvs/jupyterlab3/share/jupyter/voila/templates/base:/home/user/.virtualenvs/jupyterlab3/share/jupyter/nbconvert/templates/base:/home/user/.virtualenvs/jupyterlab3/share/jupyter:/home/user/.virtualenvs/jupyterlab3/share/jupyter/voila/templates:/home/user/.virtualenvs/jupyterlab3/share/jupyter/nbconvert/templates:/home/user/.local/share/jupyter:/home/user/.local/share/jupyter/voila/templates:/home/user/.local/share/jupyter/nbconvert/templates:/usr/local/share/jupyter:/usr/local/share/jupyter/voila/templates:/usr/local/share/jupyter/nbconvert/templates:/usr/share/jupyter:/usr/share/jupyter/voila/templates:/usr/share/jupyter/nbconvert/templates [Voila] connecting iopub channel to tcp://127.0.0.1:44209 [Voila] Connecting to: tcp://127.0.0.1:44209 [Voila] connecting shell channel to tcp://127.0.0.1:51913 [Voila] Connecting to: tcp://127.0.0.1:51913 [Voila] connecting stdin channel to tcp://127.0.0.1:53451 [Voila] Connecting to: tcp://127.0.0.1:53451 [Voila] connecting heartbeat channel to tcp://127.0.0.1:59341 [Voila] connecting control channel to tcp://127.0.0.1:56117 [Voila] Connecting to: tcp://127.0.0.1:56117 [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: stream [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: stream [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: stream [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: stream [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: stream [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: stream [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: stream [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: stream [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: stream [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (starting) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (busy) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (idle) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (busy) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (idle) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (busy) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (idle) [Voila] Executing cell: from ipywidgets import Button Button(description="button 1") [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (busy) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: execute_input [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (idle) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (busy) [Voila] msg_type: status [Voila] content: {'execution_state': 'busy'} [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: execute_input [Voila] msg_type: execute_input [Voila] content: {'code': 'from ipywidgets import Button\nButton(description="button 1")', 'execution_count': 1} [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: comm_open [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: comm_open [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: comm_open [Voila] msg_type: comm_open [Voila] content: {'data': {'state': {'_model_module': '@jupyter-widgets/base', '_model_module_version': '1.2.0', '_model_name': 'LayoutModel', '_view_count': None, '_view_module': '@jupyter-widgets/base', '_view_module_version': '1.2.0', '_view_name': 'LayoutView', 'align_content': None, 'align_items': None, 'align_self': None, 'border': None, 'bottom': None, 'display': None, 'flex': None, 'flex_flow': None, 'grid_area': None, 'grid_auto_columns': None, 'grid_auto_flow': None, 'grid_auto_rows': None, 'grid_column': None, 'grid_gap': None, 'grid_row': None, 'grid_template_areas': None, 'grid_template_columns': None, 'grid_template_rows': None, 'height': None, 'justify_content': None, 'justify_items': None, 'left': None, 'margin': None, 'max_height': None, 'max_width': None, 'min_height': None, 'min_width': None, 'object_fit': None, 'object_position': None, 'order': None, 'overflow': None, 'overflow_x': None, 'overflow_y': None, 'padding': None, 'right': None, 'top': None, 'visibility': None, 'width': None}, 'buffer_paths': []}, 'comm_id': '37632a44b6ff4351ad597e9d63b621c1', 'target_name': 'jupyter.widget', 'target_module': None} [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: display_data [Voila] msg_type: comm_open [Voila] content: {'data': {'state': {'_model_module': '@jupyter-widgets/controls', '_model_module_version': '1.5.0', '_model_name': 'ButtonStyleModel', '_view_count': None, '_view_module': '@jupyter-widgets/base', '_view_module_version': '1.2.0', '_view_name': 'StyleView', 'button_color': None, 'font_weight': ''}, 'buffer_paths': []}, 'comm_id': '31c8687822a24ee6b4ce7a76d7249f54', 'target_name': 'jupyter.widget', 'target_module': None} [Voila] msg_type: comm_open [Voila] content: {'data': {'state': {'_dom_classes': [], '_model_module': '@jupyter-widgets/controls', '_model_module_version': '1.5.0', '_model_name': 'ButtonModel', '_view_count': None, '_view_module': '@jupyter-widgets/controls', '_view_module_version': '1.5.0', '_view_name': 'ButtonView', 'button_style': '', 'description': 'button 1', 'disabled': False, 'icon': '', 'layout': 'IPY_MODEL_37632a44b6ff4351ad597e9d63b621c1', 'style': 'IPY_MODEL_31c8687822a24ee6b4ce7a76d7249f54', 'tooltip': ''}, 'buffer_paths': []}, 'comm_id': '7fb88a2931c14431b0b56a16e5582c90', 'target_name': 'jupyter.widget', 'target_module': None} [Voila] msg_type: display_data [Voila] content: {'data': {'text/plain': "Button(description='button 1', style=ButtonStyle())", 'application/vnd.jupyter.widget-view+json': {'version_major': 2, 'version_minor': 0, 'model_id': '7fb88a2931c14431b0b56a16e5582c90'}}, 'metadata': {}, 'transient': {}} [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (idle) [Voila] msg_type: status [Voila] content: {'execution_state': 'idle'} [Voila] Skipping non-executing cell 1 /home/user/.virtualenvs/jupyterlab3/lib/python3.8/site-packages/jupyter_server/base/handlers.py:197: UserWarning: The Tornado web application does not have an 'authorizer' defined in its settings. In future releases of jupyter_server, this will be a required key for all subclasses of `JupyterHandler`. For an example, see the jupyter_server source code for how to add an authorizer to the tornado settings: https://github.com/jupyter-server/jupyter_server/blob/653740cbad7ce0c8a8752ce83e4d3c2c754b13cb/jupyter_server/serverapp.py#L234-L256 warnings.warn( [Voila] Initializing websocket connection /api/kernels/eb48a2bb-76ed-47b3-9f53-6181abd3857e/channels [Voila] Requesting kernel info from eb48a2bb-76ed-47b3-9f53-6181abd3857e [Voila] Connecting to: tcp://127.0.0.1:51913 [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (busy) [Voila] Received kernel info: {'status': 'ok', 'protocol_version': '5.3', 'implementation': 'ipython', 'implementation_version': '8.4.0', 'language_info': {'name': 'python', 'version': '3.8.10', 'mimetype': 'text/x-python', 'codemirror_mode': {'name': 'ipython', 'version': 3}, 'pygments_lexer': 'ipython3', 'nbconvert_exporter': 'python', 'file_extension': '.py'}, 'banner': "Python 3.8.10 (default, Jun 22 2022, 20:18:18) \nType 'copyright', 'credits' or 'license' for more information\nIPython 8.4.0 -- An enhanced Interactive Python. Type '?' for help.\n", 'help_links': [{'text': 'Python Reference', 'url': 'https://docs.python.org/3.8'}, {'text': 'IPython Reference', 'url': 'https://ipython.org/documentation.html'}, {'text': 'NumPy Reference', 'url': 'https://docs.scipy.org/doc/numpy/reference/'}, {'text': 'SciPy Reference', 'url': 'https://docs.scipy.org/doc/scipy/reference/'}, {'text': 'Matplotlib Reference', 'url': 'https://matplotlib.org/contents.html'}, {'text': 'SymPy Reference', 'url': 'http://docs.sympy.org/latest/index.html'}, {'text': 'pandas Reference', 'url': 'https://pandas.pydata.org/pandas-docs/stable/'}]} [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (idle) [Voila] Opening websocket /api/kernels/eb48a2bb-76ed-47b3-9f53-6181abd3857e/channels [Voila] Getting buffer for eb48a2bb-76ed-47b3-9f53-6181abd3857e [Voila] Connecting to: tcp://127.0.0.1:44209 [Voila] Connecting to: tcp://127.0.0.1:51913 [Voila] Connecting to: tcp://127.0.0.1:56117 [Voila] Connecting to: tcp://127.0.0.1:53451 [Voila] Connecting to: tcp://127.0.0.1:51913 [Voila] Connecting to: tcp://127.0.0.1:56117 [Voila] Nudge: attempt 1 on kernel eb48a2bb-76ed-47b3-9f53-6181abd3857e [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (busy) [Voila] Nudge: IOPub received: eb48a2bb-76ed-47b3-9f53-6181abd3857e [Voila] Nudge: resolving iopub future: eb48a2bb-76ed-47b3-9f53-6181abd3857e [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (busy) [Voila] Nudge: shell info reply received: eb48a2bb-76ed-47b3-9f53-6181abd3857e [Voila] Nudge: resolving shell future: eb48a2bb-76ed-47b3-9f53-6181abd3857e [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (idle) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (idle) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (busy) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (idle) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (busy) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (idle) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (busy) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: comm_msg [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (idle) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (busy) [Voila] activity on eb48a2bb-76ed-47b3-9f53-6181abd3857e: status (idle) ```
Browser Output
Paste the output from your browser Javascript console here.
![image](https://user-images.githubusercontent.com/1043822/206129135-4111dd79-8721-4d79-a9fa-fdafb7a88ff5.png)

If using JupyterLab

Installed Labextensions
Paste the output from your command line running `jupyter labextension list`.
``` JupyterLab v3.5.1 /home/user/.virtualenvs/jupyterlab3/share/jupyter/labextensions jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments) @jupyter-widgets/jupyterlab-manager v3.1.1 enabled OK (python, jupyterlab_widgets) @voila-dashboards/jupyterlab-preview v2.2.0 enabled OK (python, voila) ```
trungleduc commented 1 year ago

Hi @patrickhoebeke, can you try using voila 0.4.0 with ipywidgets 8?

patrickhoebeke commented 1 year ago

Hi @trungleduc , thanks for your very quick reaction. voila 0.4.0 is already installed. I've just installed ipywidgets==8.0.2 and I have exactly the same issue. If possible, I would rather make it work for ipywidgets<8 as I have a lot of tools using ipywidgets 7 which needs some adaptation

ggogate commented 1 year ago

I had the same javascript error show up, however had worked after tweaking with ipywidgets==8.0.2 and nbconvert==7.0.0

patrickhoebeke commented 1 year ago

Thanks for you answer. I was already using nbconvert==7.2.6. Downgrading to nbconvert==7.0.0 does not help :-( @ggogate, could you post the result of the pip freeze and jupyter labextension list in a working environment ?

trungleduc commented 1 year ago

Hi @trungleduc , thanks for your very quick reaction. voila 0.4.0 is already installed. I've just installed ipywidgets==8.0.2 and I have exactly the same issue. If possible, I would rather make it work for ipywidgets<8 as I have a lot of tools using ipywidgets 7 which needs some adaptation

It works for me with the following environment:

jupyter_client            7.4.1              pyhd8ed1ab_0    conda-forge
jupyter_core              5.1.0            py39hf3d152e_0    conda-forge
jupyter_server            1.23.3             pyhd8ed1ab_0    conda-forge
jupyterlab                3.5.1              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.2.2              pyhd8ed1ab_0    conda-forge
jupyterlab_server         2.16.3             pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        3.0.3              pyhd8ed1ab_0    conda-forge
ipywidgets                8.0.2              pyhd8ed1ab_1    conda-forge
voila                     0.4.0              pyhd8ed1ab_0    conda-forge
nbconvert                 7.2.6              pyhd8ed1ab_0    conda-forge

output of jupyter labextension list

/home/****/mambaforge/envs/demo/share/jupyter/labextensions
        jupyter-leaflet v0.17.2 enabled OK
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        @voila-dashboards/jupyterlab-preview v2.2.0 enabled OK (python, voila)
        @jupyter-widgets/jupyterlab-manager v5.0.3 enabled OK (python, jupyterlab_widgets)

Voila 0.4.0 is not compatible with ipywidgets 7, but since ipywidgets is not a direct dependency of voila, we do not control its version in voila.

ggogate commented 1 year ago

Hi @patrickhoebeke, I re-created almost similar setup and attaching the sequence of commands and the working screenshot.

setup-log.txt test.docx

patrickhoebeke commented 1 year ago

Hi @ggogate

Thank you very much for your answer and your pip freeze. It took me a while to answer as I was even not able to make it work, even using pip install jupyterlab ipywidgets

Even by fixing to the same version as you had: pip install jupyterlab==3.5.1 ipywidgets==8.0.2

I finally found out, by comparing with your pip freeze that behind the scene, a different version of ipykernel was installed. You have ipykernel==6.17.1 I have ipykernel==6.19.0 Downgrading to ipykernel==6.17.1 fixed the problem

I lost almost a day trying to identify this issue and fix it. By the way, I noticed that apparently they have issues with ipykernel. Indeed, after realeasing 6.19.0, they roll back to 6.17.1 (see image below). A few minutes ago, they released 6.19.1 which seems to work now...

Finally, I still haven't found a way to make it work for ipywidgets<8 but I am so happy that it works now, that I will just stick to that version :-)

Thanks for your help !

Patrick

image

ggogate commented 1 year ago

Haha, good on you! Thanks for sharing the information about ipykernel. Ipywidgets < 8 doesn't work, moreover for me when I downgraded to ipywidgets 7. It was still working in Dev but failed on Prod where ipywidgets 8 was never installed. I may be wrong and may have missed something but it was a bit weird to have exactly the same versions working in Dev but not in prod. So would suggest to do a clean install even on dev in case you need to deploy it to production later.

:⁠-⁠)

patrickhoebeke commented 1 year ago

I think that the difficult part of the story is that installing exactly the same packages at two different moments could result in different results. It is likely because the versions of the underlying required libraries is not fixed. For example, installing jupyterlab==3.5.1 :

Ah la la ... the fun of programming :-)

shaswati1 commented 1 year ago

Hi @ggogate

Thank you very much for your answer and your pip freeze. It took me a while to answer as I was even not able to make it work, even using pip install jupyterlab ipywidgets

Even by fixing to the same version as you had: pip install jupyterlab==3.5.1 ipywidgets==8.0.2

I finally found out, by comparing with your pip freeze that behind the scene, a different version of ipykernel was installed. You have ipykernel==6.17.1 I have ipykernel==6.19.0 Downgrading to ipykernel==6.17.1 fixed the problem

I lost almost a day trying to identify this issue and fix it. By the way, I noticed that apparently they have issues with ipykernel. Indeed, after realeasing 6.19.0, they roll back to 6.17.1 (see image below). A few minutes ago, they released 6.19.1 which seems to work now...

Finally, I still haven't found a way to make it work for ipywidgets<8 but I am so happy that it works now, that I will just stick to that version :-)

Thanks for your help !

Patrick

image

This reply just saved my day! Thanks a ton! After trying a lot of things for a whole day I was able to render using voila with the configuration below: jupyterlab==3.5.1 ipywidgets==8.0.2 ipykernel==6.17.1

Previously I was using ipykernel version 6.16.1 which gave javascript error while using voila!

JuanCab commented 6 months ago

I had to upgrade to voila 0.5.6 due to the known exfiltration bug in previous versions (I was notified someone exfiltrated some files from our server and how 2 days ago). When I upgraded it, I stupidly did a conda update --all and the setup clobbered by ability to run notebooks via voila as all the ipywidgets trigger javascript console errors, as described here. My current setup has

jupyterlab==4.1.8
ipywidgets==8.1.2
ipykernel== 6.29.3

I would like to avoid downgrading the ipykernel to one from a few years ago, has anyone run into this problem recently?

patrickhoebeke commented 6 months ago

Damned. I was not aware of this security issue. Thanks for sharing... https://github.com/voila-dashboards/voila/security/advisories/GHSA-2q59-h24c-w6fg