voila-dashboards / voila

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

🐛 ipywidgets not working with latest voila release #1472

Closed ollyhensby closed 4 months ago

ollyhensby commented 4 months ago

Description

ipywidgets isn't working with the latest voila release:

Failed to load view class 'ErrorWidgetView' from module '@jupyter-widgets/base'

Reproduce

  1. Install the following environment (conda environment file):
name: voila-ipywidgets-issue
channels:
  - conda-forge
dependencies:
  - jupyterlab>=4
  - ipywidgets==8.1.2
  - voila==0.5.7
  1. Create a simple notebook (e.g. test.ipynb):
import ipywidgets as w
display(w.Button())
  1. Launch with voila:
voila test.ipynb
  1. See error: image

Expected behavior

Expect ipywidgets to load successfully in voila.

Context

Troubleshoot Output
$PATH:
        /home/jovyan/.local/bin
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/bin
        /home/jovyan/miniforge3/condabin
        /usr/local/sbin
        /usr/local/bin
        /usr/sbin
        /usr/bin
        /sbin
        /bin

sys.path:
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/bin
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/lib/python312.zip
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/lib/python3.12
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/lib/python3.12/lib-dynload
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/lib/python3.12/site-packages

sys.executable:
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/bin/python

sys.version:
        3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:38:13) [GCC 12.3.0]

platform.platform():
        Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.35

which -a jupyter:
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/bin/jupyter

pip list:
        Package                   Version
        ------------------------- --------------
        anyio                     4.3.0
        argon2-cffi               23.1.0
        argon2-cffi-bindings      21.2.0
        arrow                     1.3.0
        asttokens                 2.4.1
        async-lru                 2.0.4
        attrs                     23.2.0
        Babel                     2.14.0
        beautifulsoup4            4.12.3
        bleach                    6.1.0
        Brotli                    1.1.0
        cached-property           1.5.2
        certifi                   2024.2.2
        cffi                      1.16.0
        charset-normalizer        3.3.2
        comm                      0.2.2
        debugpy                   1.8.1
        decorator                 5.1.1
        defusedxml                0.7.1
        entrypoints               0.4
        exceptiongroup            1.2.0
        executing                 2.0.1
        fastjsonschema            2.19.1
        fqdn                      1.5.1
        h11                       0.14.0
        h2                        4.1.0
        hpack                     4.0.0
        httpcore                  1.0.5
        httpx                     0.27.0
        hyperframe                6.0.1
        idna                      3.7
        importlib_metadata        7.1.0
        importlib_resources       6.4.0
        ipykernel                 6.29.3
        ipython                   8.24.0
        ipywidgets                8.1.2
        isoduration               20.11.0
        jedi                      0.19.1
        Jinja2                    3.1.4
        json5                     0.9.25
        jsonpointer               2.4
        jsonschema                4.22.0
        jsonschema-specifications 2023.12.1
        jupyter_client            8.6.2
        jupyter_core              5.7.2
        jupyter-events            0.10.0
        jupyter-lsp               2.2.5
        jupyter_server            2.14.0
        jupyter_server_terminals  0.5.3
        jupyterlab                4.2.1
        jupyterlab_pygments       0.3.0
        jupyterlab_server         2.27.2
        jupyterlab_widgets        3.0.10
        MarkupSafe                2.1.5
        matplotlib-inline         0.1.7
        mistune                   3.0.2
        nbclient                  0.10.0
        nbconvert                 7.16.4
        nbformat                  5.10.4
        nest_asyncio              1.6.0
        notebook_shim             0.2.4
        overrides                 7.7.0
        packaging                 24.0
        pandocfilters             1.5.0
        parso                     0.8.4
        pexpect                   4.9.0
        pickleshare               0.7.5
        pip                       24.0
        pkgutil_resolve_name      1.3.10
        platformdirs              4.2.2
        prometheus_client         0.20.0
        prompt-toolkit            3.0.42
        psutil                    5.9.8
        ptyprocess                0.7.0
        pure-eval                 0.2.2
        pycparser                 2.22
        Pygments                  2.18.0
        PySocks                   1.7.1
        python-dateutil           2.9.0
        python-json-logger        2.0.7
        pytz                      2024.1
        PyYAML                    6.0.1
        pyzmq                     26.0.3
        referencing               0.35.1
        requests                  2.32.2
        rfc3339-validator         0.1.4
        rfc3986-validator         0.1.1
        rpds-py                   0.18.1
        Send2Trash                1.8.3
        setuptools                70.0.0
        six                       1.16.0
        sniffio                   1.3.1
        soupsieve                 2.5
        stack-data                0.6.2
        terminado                 0.18.1
        tinycss2                  1.3.0
        tomli                     2.0.1
        tornado                   6.4
        traitlets                 5.14.3
        types-python-dateutil     2.9.0.20240316
        typing_extensions         4.11.0
        typing-utils              0.1.0
        uri-template              1.3.0
        urllib3                   2.2.1
        voila                     0.5.7
        wcwidth                   0.2.13
        webcolors                 1.13
        webencodings              0.5.1
        websocket-client          1.8.0
        websockets                12.0
        wheel                     0.43.0
        widgetsnbextension        4.0.10
        zipp                      3.17.0

conda list:
        # packages in environment at /home/jovyan/miniforge3/envs/voila-ipywidgets-issue:
        #
        # Name                    Version                   Build  Channel
        _libgcc_mutex             0.1                 conda_forge    conda-forge
        _openmp_mutex             4.5                       2_gnu    conda-forge
        anyio                     4.3.0              pyhd8ed1ab_0    conda-forge
        argon2-cffi               23.1.0             pyhd8ed1ab_0    conda-forge
        argon2-cffi-bindings      21.2.0          py312h98912ed_4    conda-forge
        arrow                     1.3.0              pyhd8ed1ab_0    conda-forge
        asttokens                 2.4.1              pyhd8ed1ab_0    conda-forge
        async-lru                 2.0.4              pyhd8ed1ab_0    conda-forge
        attrs                     23.2.0             pyh71513ae_0    conda-forge
        babel                     2.14.0             pyhd8ed1ab_0    conda-forge
        beautifulsoup4            4.12.3             pyha770c72_0    conda-forge
        bleach                    6.1.0              pyhd8ed1ab_0    conda-forge
        brotli-python             1.1.0           py312h30efb56_1    conda-forge
        bzip2                     1.0.8                hd590300_5    conda-forge
        ca-certificates           2024.2.2             hbcca054_0    conda-forge
        cached-property           1.5.2                hd8ed1ab_1    conda-forge
        cached_property           1.5.2              pyha770c72_1    conda-forge
        certifi                   2024.2.2           pyhd8ed1ab_0    conda-forge
        cffi                      1.16.0          py312hf06ca03_0    conda-forge
        charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
        comm                      0.2.2              pyhd8ed1ab_0    conda-forge
        debugpy                   1.8.1           py312h30efb56_0    conda-forge
        decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
        defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
        entrypoints               0.4                pyhd8ed1ab_0    conda-forge
        exceptiongroup            1.2.0              pyhd8ed1ab_2    conda-forge
        executing                 2.0.1              pyhd8ed1ab_0    conda-forge
        fqdn                      1.5.1              pyhd8ed1ab_0    conda-forge
        h11                       0.14.0             pyhd8ed1ab_0    conda-forge
        h2                        4.1.0              pyhd8ed1ab_0    conda-forge
        hpack                     4.0.0              pyh9f0ad1d_0    conda-forge
        httpcore                  1.0.5              pyhd8ed1ab_0    conda-forge
        httpx                     0.27.0             pyhd8ed1ab_0    conda-forge
        hyperframe                6.0.1              pyhd8ed1ab_0    conda-forge
        idna                      3.7                pyhd8ed1ab_0    conda-forge
        importlib-metadata        7.1.0              pyha770c72_0    conda-forge
        importlib_metadata        7.1.0                hd8ed1ab_0    conda-forge
        importlib_resources       6.4.0              pyhd8ed1ab_0    conda-forge
        ipykernel                 6.29.3             pyhd33586a_0    conda-forge
        ipython                   8.24.0             pyh707e725_0    conda-forge
        ipywidgets                8.1.2              pyhd8ed1ab_1    conda-forge
        isoduration               20.11.0            pyhd8ed1ab_0    conda-forge
        jedi                      0.19.1             pyhd8ed1ab_0    conda-forge
        jinja2                    3.1.4              pyhd8ed1ab_0    conda-forge
        json5                     0.9.25             pyhd8ed1ab_0    conda-forge
        jsonpointer               2.4             py312h7900ff3_3    conda-forge
        jsonschema                4.22.0             pyhd8ed1ab_0    conda-forge
        jsonschema-specifications 2023.12.1          pyhd8ed1ab_0    conda-forge
        jsonschema-with-format-nongpl 4.22.0             pyhd8ed1ab_0    conda-forge
        jupyter-lsp               2.2.5              pyhd8ed1ab_0    conda-forge
        jupyter_client            8.6.2              pyhd8ed1ab_0    conda-forge
        jupyter_core              5.7.2           py312h7900ff3_0    conda-forge
        jupyter_events            0.10.0             pyhd8ed1ab_0    conda-forge
        jupyter_server            2.14.0             pyhd8ed1ab_0    conda-forge
        jupyter_server_terminals  0.5.3              pyhd8ed1ab_0    conda-forge
        jupyterlab                4.2.1              pyhd8ed1ab_0    conda-forge
        jupyterlab_pygments       0.3.0              pyhd8ed1ab_1    conda-forge
        jupyterlab_server         2.27.2             pyhd8ed1ab_0    conda-forge
        jupyterlab_widgets        3.0.10             pyhd8ed1ab_0    conda-forge
        keyutils                  1.6.1                h166bdaf_0    conda-forge
        krb5                      1.21.2               h659d440_0    conda-forge
        ld_impl_linux-64          2.40                 h55db66e_0    conda-forge
        libedit                   3.1.20191231         he28a2e2_2    conda-forge
        libexpat                  2.6.2                h59595ed_0    conda-forge
        libffi                    3.4.2                h7f98852_5    conda-forge
        libgcc-ng                 13.2.0               h77fa898_7    conda-forge
        libgomp                   13.2.0               h77fa898_7    conda-forge
        libnsl                    2.0.1                hd590300_0    conda-forge
        libsodium                 1.0.18               h36c2ea0_1    conda-forge
        libsqlite                 3.45.3               h2797004_0    conda-forge
        libstdcxx-ng              13.2.0               hc0a3c3a_7    conda-forge
        libuuid                   2.38.1               h0b41bf4_0    conda-forge
        libxcrypt                 4.4.36               hd590300_1    conda-forge
        libzlib                   1.2.13               hd590300_5    conda-forge
        markupsafe                2.1.5           py312h98912ed_0    conda-forge
        matplotlib-inline         0.1.7              pyhd8ed1ab_0    conda-forge
        mistune                   3.0.2              pyhd8ed1ab_0    conda-forge
        nbclient                  0.10.0             pyhd8ed1ab_0    conda-forge
        nbconvert                 7.16.4               hd8ed1ab_0    conda-forge
        nbconvert-core            7.16.4             pyhd8ed1ab_0    conda-forge
        nbconvert-pandoc          7.16.4               hd8ed1ab_0    conda-forge
        nbformat                  5.10.4             pyhd8ed1ab_0    conda-forge
        ncurses                   6.5                  h59595ed_0    conda-forge
        nest-asyncio              1.6.0              pyhd8ed1ab_0    conda-forge
        notebook-shim             0.2.4              pyhd8ed1ab_0    conda-forge
        openssl                   3.3.0                h4ab18f5_3    conda-forge
        overrides                 7.7.0              pyhd8ed1ab_0    conda-forge
        packaging                 24.0               pyhd8ed1ab_0    conda-forge
        pandoc                    3.2                  ha770c72_0    conda-forge
        pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
        parso                     0.8.4              pyhd8ed1ab_0    conda-forge
        pexpect                   4.9.0              pyhd8ed1ab_0    conda-forge
        pickleshare               0.7.5                   py_1003    conda-forge
        pip                       24.0               pyhd8ed1ab_0    conda-forge
        pkgutil-resolve-name      1.3.10             pyhd8ed1ab_1    conda-forge
        platformdirs              4.2.2              pyhd8ed1ab_0    conda-forge
        prometheus_client         0.20.0             pyhd8ed1ab_0    conda-forge
        prompt-toolkit            3.0.42             pyha770c72_0    conda-forge
        psutil                    5.9.8           py312h98912ed_0    conda-forge
        ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
        pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
        pycparser                 2.22               pyhd8ed1ab_0    conda-forge
        pygments                  2.18.0             pyhd8ed1ab_0    conda-forge
        pysocks                   1.7.1              pyha2e5f31_6    conda-forge
        python                    3.12.3          hab00c5b_0_cpython    conda-forge
        python-dateutil           2.9.0              pyhd8ed1ab_0    conda-forge
        python-fastjsonschema     2.19.1             pyhd8ed1ab_0    conda-forge
        python-json-logger        2.0.7              pyhd8ed1ab_0    conda-forge
        python_abi                3.12                    4_cp312    conda-forge
        pytz                      2024.1             pyhd8ed1ab_0    conda-forge
        pyyaml                    6.0.1           py312h98912ed_1    conda-forge
        pyzmq                     26.0.3          py312h8fd38d8_0    conda-forge
        readline                  8.2                  h8228510_1    conda-forge
        referencing               0.35.1             pyhd8ed1ab_0    conda-forge
        requests                  2.32.2             pyhd8ed1ab_0    conda-forge
        rfc3339-validator         0.1.4              pyhd8ed1ab_0    conda-forge
        rfc3986-validator         0.1.1              pyh9f0ad1d_0    conda-forge
        rpds-py                   0.18.1          py312h4413252_0    conda-forge
        send2trash                1.8.3              pyh0d859eb_0    conda-forge
        setuptools                70.0.0             pyhd8ed1ab_0    conda-forge
        six                       1.16.0             pyh6c4a22f_0    conda-forge
        sniffio                   1.3.1              pyhd8ed1ab_0    conda-forge
        soupsieve                 2.5                pyhd8ed1ab_1    conda-forge
        stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
        terminado                 0.18.1             pyh0d859eb_0    conda-forge
        tinycss2                  1.3.0              pyhd8ed1ab_0    conda-forge
        tk                        8.6.13          noxft_h4845f30_101    conda-forge
        tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
        tornado                   6.4             py312h98912ed_0    conda-forge
        traitlets                 5.14.3             pyhd8ed1ab_0    conda-forge
        types-python-dateutil     2.9.0.20240316     pyhd8ed1ab_0    conda-forge
        typing-extensions         4.11.0               hd8ed1ab_0    conda-forge
        typing_extensions         4.11.0             pyha770c72_0    conda-forge
        typing_utils              0.1.0              pyhd8ed1ab_0    conda-forge
        tzdata                    2024a                h0c530f3_0    conda-forge
        uri-template              1.3.0              pyhd8ed1ab_0    conda-forge
        urllib3                   2.2.1              pyhd8ed1ab_0    conda-forge
        voila                     0.5.7              pyhd8ed1ab_1    conda-forge
        wcwidth                   0.2.13             pyhd8ed1ab_0    conda-forge
        webcolors                 1.13               pyhd8ed1ab_0    conda-forge
        webencodings              0.5.1              pyhd8ed1ab_2    conda-forge
        websocket-client          1.8.0              pyhd8ed1ab_0    conda-forge
        websockets                12.0            py312h98912ed_0    conda-forge
        wheel                     0.43.0             pyhd8ed1ab_1    conda-forge
        widgetsnbextension        4.0.10             pyhd8ed1ab_0    conda-forge
        xz                        5.2.6                h166bdaf_0    conda-forge
        yaml                      0.2.5                h7f98852_2    conda-forge
        zeromq                    4.3.5                h75354e8_4    conda-forge
        zipp                      3.17.0             pyhd8ed1ab_0    conda-forge

conda env:
        name: voila-ipywidgets-issue
        channels:
          - conda-forge
        dependencies:
          - _libgcc_mutex=0.1=conda_forge
          - _openmp_mutex=4.5=2_gnu
          - anyio=4.3.0=pyhd8ed1ab_0
          - argon2-cffi=23.1.0=pyhd8ed1ab_0
          - argon2-cffi-bindings=21.2.0=py312h98912ed_4
          - arrow=1.3.0=pyhd8ed1ab_0
          - asttokens=2.4.1=pyhd8ed1ab_0
          - async-lru=2.0.4=pyhd8ed1ab_0
          - attrs=23.2.0=pyh71513ae_0
          - babel=2.14.0=pyhd8ed1ab_0
          - beautifulsoup4=4.12.3=pyha770c72_0
          - bleach=6.1.0=pyhd8ed1ab_0
          - brotli-python=1.1.0=py312h30efb56_1
          - bzip2=1.0.8=hd590300_5
          - ca-certificates=2024.2.2=hbcca054_0
          - cached-property=1.5.2=hd8ed1ab_1
          - cached_property=1.5.2=pyha770c72_1
          - certifi=2024.2.2=pyhd8ed1ab_0
          - cffi=1.16.0=py312hf06ca03_0
          - charset-normalizer=3.3.2=pyhd8ed1ab_0
          - comm=0.2.2=pyhd8ed1ab_0
          - debugpy=1.8.1=py312h30efb56_0
          - decorator=5.1.1=pyhd8ed1ab_0
          - defusedxml=0.7.1=pyhd8ed1ab_0
          - entrypoints=0.4=pyhd8ed1ab_0
          - exceptiongroup=1.2.0=pyhd8ed1ab_2
          - executing=2.0.1=pyhd8ed1ab_0
          - fqdn=1.5.1=pyhd8ed1ab_0
          - h11=0.14.0=pyhd8ed1ab_0
          - h2=4.1.0=pyhd8ed1ab_0
          - hpack=4.0.0=pyh9f0ad1d_0
          - httpcore=1.0.5=pyhd8ed1ab_0
          - httpx=0.27.0=pyhd8ed1ab_0
          - hyperframe=6.0.1=pyhd8ed1ab_0
          - idna=3.7=pyhd8ed1ab_0
          - importlib-metadata=7.1.0=pyha770c72_0
          - importlib_metadata=7.1.0=hd8ed1ab_0
          - importlib_resources=6.4.0=pyhd8ed1ab_0
          - ipykernel=6.29.3=pyhd33586a_0
          - ipython=8.24.0=pyh707e725_0
          - ipywidgets=8.1.2=pyhd8ed1ab_1
          - isoduration=20.11.0=pyhd8ed1ab_0
          - jedi=0.19.1=pyhd8ed1ab_0
          - jinja2=3.1.4=pyhd8ed1ab_0
          - json5=0.9.25=pyhd8ed1ab_0
          - jsonpointer=2.4=py312h7900ff3_3
          - jsonschema=4.22.0=pyhd8ed1ab_0
          - jsonschema-specifications=2023.12.1=pyhd8ed1ab_0
          - jsonschema-with-format-nongpl=4.22.0=pyhd8ed1ab_0
          - jupyter-lsp=2.2.5=pyhd8ed1ab_0
          - jupyter_client=8.6.2=pyhd8ed1ab_0
          - jupyter_core=5.7.2=py312h7900ff3_0
          - jupyter_events=0.10.0=pyhd8ed1ab_0
          - jupyter_server=2.14.0=pyhd8ed1ab_0
          - jupyter_server_terminals=0.5.3=pyhd8ed1ab_0
          - jupyterlab=4.2.1=pyhd8ed1ab_0
          - jupyterlab_pygments=0.3.0=pyhd8ed1ab_1
          - jupyterlab_server=2.27.2=pyhd8ed1ab_0
          - jupyterlab_widgets=3.0.10=pyhd8ed1ab_0
          - keyutils=1.6.1=h166bdaf_0
          - krb5=1.21.2=h659d440_0
          - ld_impl_linux-64=2.40=h55db66e_0
          - libedit=3.1.20191231=he28a2e2_2
          - libexpat=2.6.2=h59595ed_0
          - libffi=3.4.2=h7f98852_5
          - libgcc-ng=13.2.0=h77fa898_7
          - libgomp=13.2.0=h77fa898_7
          - libnsl=2.0.1=hd590300_0
          - libsodium=1.0.18=h36c2ea0_1
          - libsqlite=3.45.3=h2797004_0
          - libstdcxx-ng=13.2.0=hc0a3c3a_7
          - libuuid=2.38.1=h0b41bf4_0
          - libxcrypt=4.4.36=hd590300_1
          - libzlib=1.2.13=hd590300_5
          - markupsafe=2.1.5=py312h98912ed_0
          - matplotlib-inline=0.1.7=pyhd8ed1ab_0
          - mistune=3.0.2=pyhd8ed1ab_0
          - nbclient=0.10.0=pyhd8ed1ab_0
          - nbconvert=7.16.4=hd8ed1ab_0
          - nbconvert-core=7.16.4=pyhd8ed1ab_0
          - nbconvert-pandoc=7.16.4=hd8ed1ab_0
          - nbformat=5.10.4=pyhd8ed1ab_0
          - ncurses=6.5=h59595ed_0
          - nest-asyncio=1.6.0=pyhd8ed1ab_0
          - notebook-shim=0.2.4=pyhd8ed1ab_0
          - openssl=3.3.0=h4ab18f5_3
          - overrides=7.7.0=pyhd8ed1ab_0
          - packaging=24.0=pyhd8ed1ab_0
          - pandoc=3.2=ha770c72_0
          - pandocfilters=1.5.0=pyhd8ed1ab_0
          - parso=0.8.4=pyhd8ed1ab_0
          - pexpect=4.9.0=pyhd8ed1ab_0
          - pickleshare=0.7.5=py_1003
          - pip=24.0=pyhd8ed1ab_0
          - pkgutil-resolve-name=1.3.10=pyhd8ed1ab_1
          - platformdirs=4.2.2=pyhd8ed1ab_0
          - prometheus_client=0.20.0=pyhd8ed1ab_0
          - prompt-toolkit=3.0.42=pyha770c72_0
          - psutil=5.9.8=py312h98912ed_0
          - ptyprocess=0.7.0=pyhd3deb0d_0
          - pure_eval=0.2.2=pyhd8ed1ab_0
          - pycparser=2.22=pyhd8ed1ab_0
          - pygments=2.18.0=pyhd8ed1ab_0
          - pysocks=1.7.1=pyha2e5f31_6
          - python=3.12.3=hab00c5b_0_cpython
          - python-dateutil=2.9.0=pyhd8ed1ab_0
          - python-fastjsonschema=2.19.1=pyhd8ed1ab_0
          - python-json-logger=2.0.7=pyhd8ed1ab_0
          - python_abi=3.12=4_cp312
          - pytz=2024.1=pyhd8ed1ab_0
          - pyyaml=6.0.1=py312h98912ed_1
          - pyzmq=26.0.3=py312h8fd38d8_0
          - readline=8.2=h8228510_1
          - referencing=0.35.1=pyhd8ed1ab_0
          - requests=2.32.2=pyhd8ed1ab_0
          - rfc3339-validator=0.1.4=pyhd8ed1ab_0
          - rfc3986-validator=0.1.1=pyh9f0ad1d_0
          - rpds-py=0.18.1=py312h4413252_0
          - send2trash=1.8.3=pyh0d859eb_0
          - setuptools=70.0.0=pyhd8ed1ab_0
          - six=1.16.0=pyh6c4a22f_0
          - sniffio=1.3.1=pyhd8ed1ab_0
          - soupsieve=2.5=pyhd8ed1ab_1
          - stack_data=0.6.2=pyhd8ed1ab_0
          - terminado=0.18.1=pyh0d859eb_0
          - tinycss2=1.3.0=pyhd8ed1ab_0
          - tk=8.6.13=noxft_h4845f30_101
          - tomli=2.0.1=pyhd8ed1ab_0
          - tornado=6.4=py312h98912ed_0
          - traitlets=5.14.3=pyhd8ed1ab_0
          - types-python-dateutil=2.9.0.20240316=pyhd8ed1ab_0
          - typing-extensions=4.11.0=hd8ed1ab_0
          - typing_extensions=4.11.0=pyha770c72_0
          - typing_utils=0.1.0=pyhd8ed1ab_0
          - tzdata=2024a=h0c530f3_0
          - uri-template=1.3.0=pyhd8ed1ab_0
          - urllib3=2.2.1=pyhd8ed1ab_0
          - voila=0.5.7=pyhd8ed1ab_1
          - wcwidth=0.2.13=pyhd8ed1ab_0
          - webcolors=1.13=pyhd8ed1ab_0
          - webencodings=0.5.1=pyhd8ed1ab_2
          - websocket-client=1.8.0=pyhd8ed1ab_0
          - websockets=12.0=py312h98912ed_0
          - wheel=0.43.0=pyhd8ed1ab_1
          - widgetsnbextension=4.0.10=pyhd8ed1ab_0
          - xz=5.2.6=h166bdaf_0
          - yaml=0.2.5=h7f98852_2
          - zeromq=4.3.5=h75354e8_4
          - zipp=3.17.0=pyhd8ed1ab_0
        prefix: /home/jovyan/miniforge3/envs/voila-ipywidgets-issue
Command Line Output
[Voila] Looking for voila in /etc/jupyter
[Voila] Looking for voila in /usr/local/etc/jupyter
[Voila] Looking for voila in /home/jovyan/.local/etc/jupyter
[Voila] Looking for voila in /home/jovyan/.jupyter
[Voila] Looking for voila in /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/etc/jupyter
[Voila] Looking for voila in /home/jovyan/git/personal/voila-ipywidgets-issue
[Voila] using template: lab
[Voila] template paths:
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/share/jupyter/voila/templates/lab
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/share/jupyter/nbconvert/templates/lab
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/share/jupyter/voila/templates/base
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/share/jupyter/nbconvert/templates/base
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/share/jupyter
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/share/jupyter/voila/templates
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/share/jupyter/nbconvert/templates
        /home/jovyan/.local/share/jupyter
        /home/jovyan/.local/share/jupyter/voila/templates
        /home/jovyan/.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/jovyan/miniforge3/envs/voila-ipywidgets-issue/share/jupyter/voila/templates/lab/static
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/share/jupyter/nbconvert/templates/lab/static
        /home/jovyan/.local/share/jupyter/voila/templates/lab/static
        /home/jovyan/.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/jovyan/miniforge3/envs/voila-ipywidgets-issue/share/jupyter/voila/templates/base/static
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/share/jupyter/nbconvert/templates/base/static
        /home/jovyan/.local/share/jupyter/voila/templates/base/static
        /home/jovyan/.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
        /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/lib/python3.12/site-packages/jupyter_server/static
[Voila] Using /tmp to store connection files
[Voila] Storing connection files in /tmp/voila_ncv_sguk.
[Voila] Serving static files from /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/lib/python3.12/site-packages/voila/static.
[Voila] Voilà is running at:
http://localhost:8866/
gio: file:///tmp/tmp756o7tgy.html: No application is registered as handling this file
Browser Output
(index):41 
Error: No version of module @jupyter-widgets/base is registered
    at _.loadClass (7018.voila.js:1:77776)
    at _.loadModelClass (7018.voila.js:1:74726)
    at _._make_model (7018.voila.js:1:71514)
    at _.new_model (7018.voila.js:1:69103)
    at 7018.voila.js:1:70382
    at Array.map ()
    at _._loadFromKernel (7018.voila.js:1:70275)
    at async _.restoreWidgets (7018.voila.js:1:79265)
2
(index):41 
Error: No version of module @jupyter-widgets/controls is registered
    at _.loadClass (7018.voila.js:1:77776)
    at _.loadModelClass (7018.voila.js:1:74726)
    at _._make_model (7018.voila.js:1:71514)
    at _.new_model (7018.voila.js:1:69103)
    at 7018.voila.js:1:70382
    at Array.map ()
    at _._loadFromKernel (7018.voila.js:1:70275)
    at async _.restoreWidgets (7018.voila.js:1:79265)
(index):41 
Error: No version of module @jupyter-widgets/base is registered
    at _.loadClass (7018.voila.js:1:77776)
    at _.loadViewClass (7018.voila.js:1:74931)
    at 7018.voila.js:1:66785
    at async g.renderModel (7018.voila.js:1:65329)
2
(index):41 
Error: No version of module @jupyter-widgets/base is registered
    at _.loadClass (7018.voila.js:1:77776)
    at _.loadViewClass (7018.voila.js:1:74931)
    at 7018.voila.js:1:66785

If using JupyterLab

Installed Labextensions
JupyterLab v4.2.1
/home/jovyan/miniforge3/envs/voila-ipywidgets-issue/share/jupyter/labextensions
        jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
        @jupyter-widgets/jupyterlab-manager v5.0.10 enabled OK (python, jupyterlab_widgets)
        @voila-dashboards/jupyterlab-preview v2.3.7 enabled OK (python, voila)
trungleduc commented 4 months ago

Thanks for reporting, we will take a look at it.

martinRenou commented 4 months ago

Both @trungleduc and I are not able to reproduce the issue you mention.

Also, our CI is testing jupyter widgets in voila (both core widgets and custom widgets) and the CI tests are passing fine on main.

I am really surprised by Error: No version of module @jupyter-widgets/base is registered, @jupyter-widgets/base is provided by Voila itself, it should always be there.

Would you be able to run jupyter --paths and inspect all the list directories to see if you don't have rogue extensions installed in non-wanted places (outside of the conda env itself), if so try removing them?

ollyhensby commented 4 months ago

Both @trungleduc and I are not able to reproduce the issue you mention.

Also, our CI is testing jupyter widgets in voila (both core widgets and custom widgets) and the CI tests are passing fine on main.

I am really surprised by Error: No version of module @jupyter-widgets/base is registered, @jupyter-widgets/base is provided by Voila itself, it should always be there.

Would you be able to run jupyter --paths and inspect all the list directories to see if you don't have rogue extensions installed in non-wanted places (outside of the conda env itself), if so try removing them?

Strange. I am running in WSL which maybe could be making the difference but I am not sure how that would affect this.

jupyter --paths produces this output:

config:
    /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/etc/jupyter
    /home/jovyan/.jupyter
    /home/jovyan/.local/etc/jupyter
    /usr/local/etc/jupyter
    /etc/jupyter
data:
    /home/jovyan/miniforge3/envs/voila-ipywidgets-issue/share/jupyter
    /home/jovyan/.local/share/jupyter
    /usr/local/share/jupyter
    /usr/share/jupyter
runtime:
    /home/jovyan/.local/share/jupyter/runtime
ollyhensby commented 4 months ago

I also did a fresh install of Ubuntu 22.04 and tried again but unfortunately got the same error.

It appears that Voila preview is working as expected though:

image

But fails on voila test.ipynb as mentioned above.

ollyhensby commented 4 months ago

Just did a bit more research into this issue. I created a simple repository so that I could deploy it to binder.

I launched with binder and it works: https://mybinder.org/v2/gh/ollyhensby/voila-ipywidgets-issue/HEAD?urlpath=voila%2Frender%2Ftest.ipynb

image

Must be something to do with my setup locally so will have a look into that some more.

ollyhensby commented 4 months ago

So I cleared all cached images and files in my browser and that appears to have resolved this issue. If in doubt, clear the browser cache!

Thanks for the help anyways. Will close this issue.

martinRenou commented 4 months ago

Thanks for the detailed feedback! Indeed invalid cache can be annoying