voila-dashboards / voila

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

cannot launch voila notebook: ImportError: cannot import name 'ZMQChannelsHandler' from 'jupyter_server.services.kernels.handlers' #1294

Open 12rambau opened 1 year ago

12rambau commented 1 year ago

Description

I installed a fresh environment on my new computer and I don't manage to run notebooks with voila anymore. when running

voila ui.ipynb

I got the following error:

ImportError: cannot import name 'ZMQChannelsHandler' from 'jupyter_server.services.kernels.handlers'

Reproduce

the only package I installed is voila using:

sudo pip install jupyter voila

I try to open an empty notebook

Expected behavior

It's still running on my old computer but it's a mac -> PC (with WLS2) so I cannot really compare anything

Context

Troubleshoot Output
$PATH:
        /home/borntobealive/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/bin/remote-cli
        /home/borntobealive/.local/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/Windows
        /mnt/c/Windows/System32/Wbem
        /mnt/c/Windows/System32/WindowsPowerShell/v1.0/
        /mnt/c/Windows/System32/OpenSSH/
        /mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common
        /mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR
        /mnt/c/WINDOWS/system32
        /mnt/c/WINDOWS
        /mnt/c/WINDOWS/System32/Wbem
        /mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/
        /mnt/c/WINDOWS/System32/OpenSSH/
        /mnt/c/Users/pierr/AppData/Local/Microsoft/WindowsApps
        /mnt/c/Users/pierr/AppData/Local/Programs/Microsoft VS Code/bin
        /snap/bin

sys.path:
        /home/borntobealive/.local/bin
        /usr/lib/python310.zip
        /usr/lib/python3.10
        /usr/lib/python3.10/lib-dynload
        /home/borntobealive/.local/lib/python3.10/site-packages
        __editable__.sepal_ui-2.15.1.finder.__path_hook__
        /home/borntobealive/libs/images
        /home/borntobealive/libs/video
        /home/borntobealive/libs/ipyvuetify
        /home/borntobealive/libs/pydata-sphinx-theme/src
        /home/borntobealive/libs/youtube
        /usr/local/lib/python3.10/dist-packages
        /home/borntobealive/libs/commitizen
        /usr/lib/python3/dist-packages

sys.executable:
        /usr/bin/python3

sys.version:
        3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]

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

which -a jupyter:
        /home/borntobealive/.local/bin/jupyter
        /usr/local/bin/jupyter

pip list:
        Package                       Version        Editable project location
        ----------------------------- -------------- --------------------------------------------
        accessible-pygments           0.0.3
        affine                        2.4.0
        aiofiles                      22.1.0
        aiohttp                       3.8.4
        aiosignal                     1.3.1
        aiosqlite                     0.18.0
        alabaster                     0.7.13
        anyio                         3.6.2
        appdirs                       1.4.4
        argcomplete                   2.0.0
        argon2-cffi                   21.3.0
        argon2-cffi-bindings          21.2.0
        arrow                         1.2.3
        async-timeout                 4.0.2
        attrs                         21.2.0
        Babel                         2.11.0
        backcall                      0.2.0
        beautifulsoup4                4.10.0
        beniget                       0.4.1
        bleach                        6.0.0
        blinker                       1.4
        branca                        0.6.0
        Brotli                        1.0.9
        build                         0.10.0
        cachetools                    5.3.0
        certifi                       2022.12.7
        cffi                          1.15.1
        cfgv                          3.3.1
        chardet                       5.1.0
        charset-normalizer            3.0.1
        click                         8.1.3
        click-plugins                 1.1.1
        cligj                         0.7.2
        cloudpickle                   2.2.1
        colorama                      0.4.6
        colorlog                      6.7.0
        comm                          0.1.2
        command-not-found             0.3
        commitizen                    2.42.0         /home/borntobealive/libs/commitizen
        cryptography                  3.4.8
        cycler                        0.11.0
        dask                          2023.2.0
        dbus-python                   1.2.18
        debugpy                       1.6.6
        decli                         0.5.2
        decorator                     4.4.2
        defusedxml                    0.7.1
        Deprecated                    1.2.13
        distlib                       0.3.6
        distro                        1.7.0
        distro-info                   1.1build1
        docopt                        0.6.2
        docutils                      0.19
        earthengine-api               0.1.341
        entrypoints                   0.4
        exceptiongroup                1.1.0
        fastjsonschema                2.16.2
        filelock                      3.9.0
        Fiona                         1.9.1
        fonttools                     4.29.1
        fqdn                          1.5.1
        frozenlist                    1.3.3
        fs                            2.4.12
        fsspec                        2023.1.0
        gast                          0.5.2
        geojson                       3.0.1
        geopandas                     0.12.2
        google-api-core               2.11.0
        google-api-python-client      2.78.0
        google-auth                   2.16.1
        google-auth-httplib2          0.1.0
        google-cloud-core             2.3.2
        google-cloud-storage          2.7.0
        google-crc32c                 1.5.0
        google-resumable-media        2.4.1
        googleapis-common-protos      1.58.0
        gyp                           0.1
        h11                           0.12.0
        html5lib                      1.1
        httpcore                      0.15.0
        httplib2                      0.20.2
        httpx                         0.23.0
        identify                      2.5.18
        idna                          3.4
        imagesize                     1.4.1
        importlib-metadata            4.6.4
        ini2toml                      0.11.3
        iniconfig                     2.0.0
        ipykernel                     6.21.2
        ipyleaflet                    0.17.2
        ipython                       7.31.1
        ipython-genutils              0.2.0
        ipyvue                        1.8.0
        ipyvuetify                    1.8.4          /home/borntobealive/libs/ipyvuetify
        ipywidgets                    8.0.4
        isoduration                   20.11.0
        jedi                          0.18.0
        jeepney                       0.7.1
        Jinja2                        3.1.2
        json5                         0.9.11
        jsonpointer                   2.3
        jsonschema                    4.17.3
        jupyter                       1.0.0
        jupyter_client                8.0.2
        jupyter-console               6.6.2
        jupyter_core                  5.2.0
        jupyter-events                0.5.0
        jupyter_server                2.3.0
        jupyter_server_fileid         0.6.0
        jupyter-server-proxy          3.2.2
        jupyter_server_terminals      0.4.4
        jupyter_server_ydoc           0.6.1
        jupyter-ydoc                  0.2.2
        jupyterlab                    3.6.1
        jupyterlab-pygments           0.2.2
        jupyterlab_server             2.19.0
        jupyterlab-widgets            3.0.5
        keyring                       23.5.0
        kiwisolver                    1.3.2
        launchpadlib                  1.10.16
        lazr.restfulclient            0.14.4
        lazr.uri                      1.0.6
        locket                        1.0.0
        lxml                          4.8.0
        lz4                           3.1.3+dfsg
        Markdown                      3.4.1
        MarkupSafe                    2.1.2
        matplotlib                    3.5.1
        matplotlib-inline             0.1.3
        mistune                       2.0.5
        more-itertools                8.10.0
        mpmath                        0.0.0
        multidict                     6.0.4
        munch                         2.5.0
        mypy                          1.0.1
        mypy-extensions               1.0.0
        natsort                       8.2.0
        nbclassic                     0.5.1
        nbclient                      0.7.2
        nbconvert                     7.2.9
        nbformat                      5.7.3
        nest-asyncio                  1.5.6
        netifaces                     0.11.0
        nodeenv                       1.7.0
        notebook                      6.5.2
        notebook_shim                 0.2.2
        nox                           2022.11.21
        numpy                         1.21.5
        oauthlib                      3.2.0
        olefile                       0.46
        packaging                     23.0
        pandas                        1.5.3
        pandocfilters                 1.5.0
        parso                         0.8.1
        partd                         1.3.0
        pbr                           5.11.1
        pexpect                       4.8.0
        pickleshare                   0.7.5
        Pillow                        9.0.1
        pip                           23.0.1
        pipreqs                       0.4.11
        planet                        2.0a6
        platformdirs                  3.0.0
        pluggy                        1.0.0
        ply                           3.11
        pre-commit                    3.0.4
        prometheus-client             0.16.0
        prompt-toolkit                3.0.36
        protobuf                      4.22.0
        psutil                        5.9.4
        ptyprocess                    0.7.0
        pyarrow                       11.0.0
        pyasn1                        0.4.8
        pyasn1-modules                0.2.8
        pycparser                     2.21
        pydata-sphinx-theme           0.13.0rc4.dev0 /home/borntobealive/libs/pydata-sphinx-theme
        pygadm                        0.2.0
        Pygments                      2.14.0
        PyGObject                     3.42.1
        PyJWT                         2.3.0
        pynpm                         0.1.2
        pyparsing                     2.4.7
        pyproj                        3.4.1
        pyproject_api                 1.5.0
        pyproject_hooks               1.0.0
        pyrsistent                    0.19.3
        pytest                        7.2.1
        python-apt                    2.4.0
        python-box                    7.0.0
        python-dateutil               2.8.2
        python-json-logger            2.0.6
        pythran                       0.10.0
        pytz                          2022.1
        PyYAML                        5.4.1
        pyzmq                         25.0.0
        qtconsole                     5.4.0
        QtPy                          2.3.0
        questionary                   1.10.0
        rasterio                      1.3.6
        requests                      2.28.2
        rfc3339-validator             0.1.4
        rfc3986                       1.5.0
        rfc3986-validator             0.1.1
        rioxarray                     0.13.3
        rsa                           4.9
        scipy                         1.8.0
        SecretStorage                 3.3.1
        Send2Trash                    1.8.0
        sepal-ui                      2.15.1         /home/borntobealive/libs/sepal_ui
        setuptools                    67.3.2
        shapely                       2.0.1
        simpervisor                   0.4
        six                           1.16.0
        sniffio                       1.3.0
        snowballstemmer               2.2.0
        snuggs                        1.4.7
        soupsieve                     2.3.1
        Sphinx                        6.1.3
        sphinx-icon                   0.2.1
        sphinxcontrib-applehelp       1.0.4
        sphinxcontrib-devhelp         1.0.2
        sphinxcontrib-htmlhelp        2.0.1
        sphinxcontrib-images          0.9.4          /home/borntobealive/libs/images
        sphinxcontrib-jsmath          1.0.1
        sphinxcontrib-qthelp          1.0.3
        sphinxcontrib-serializinghtml 1.1.5
        sphinxcontrib-video           0.0.0          /home/borntobealive/libs/video
        sphinxcontrib-youtube         1.2.0          /home/borntobealive/libs/youtube
        sympy                         1.9
        systemd-python                234
        termcolor                     2.2.0
        terminado                     0.17.1
        tinycss2                      1.2.1
        tomli                         2.0.1
        tomlkit                       0.11.6
        toolz                         0.12.0
        tornado                       6.2
        tox                           4.4.5
        tqdm                          4.64.1
        traitlets                     5.9.0
        traittypes                    0.2.1
        types-docutils                0.19.1.5
        typing_extensions             4.5.0
        ubuntu-advantage-tools        8001
        ufoLib2                       0.13.1
        ufw                           0.36.1
        unattended-upgrades           0.1
        unicodedata2                  14.0.0
        Unidecode                     1.3.6
        UNKNOWN                       0.0.0
        uri-template                  1.2.0
        uritemplate                   4.1.1
        urllib3                       1.26.14
        virtualenv                    20.19.0
        voila                         0.4.0
        wadllib                       1.3.6
        wcwidth                       0.2.5
        webcolors                     1.12
        webencodings                  0.5.1
        websocket-client              1.5.1
        websockets                    10.4
        wheel                         0.37.1
        widgetsnbextension            4.0.5
        wrapt                         1.14.1
        xarray                        2023.2.0
        xyzservices                   2022.9.0
        y-py                          0.5.5
        yarg                          0.1.9
        yarl                          1.8.2
        ypy-websocket                 0.8.2
        zipp                          1.0.0
Command Line Output
Traceback (most recent call last):
  File "/usr/local/bin/voila", line 5, in 
    from voila.app import main
  File "/usr/local/lib/python3.10/dist-packages/voila/app.py", line 40, in 
    from jupyter_server.services.kernels.handlers import KernelHandler, ZMQChannelsHandler
ImportError: cannot import name 'ZMQChannelsHandler' from 'jupyter_server.services.kernels.handlers' (/home/borntobealive/.local/lib/python3.10/site-packages/jupyter_server/services/kernels/handlers.py)

If using JupyterLab

Installed Labextensions
JupyterLab v3.6.1
/home/borntobealive/.local/share/jupyter/labextensions
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        jupyter-vue v1.8.0 enabled OK
        jupyter-leaflet v0.17.2 enabled OK
        @jupyterlab/server-proxy v3.2.2 enabled OK
        @jupyter-widgets/jupyterlab-manager v5.0.5 enabled OK (python, jupyterlab_widgets)

/usr/local/share/jupyter/labextensions
        @voila-dashboards/jupyterlab-preview v2.2.0 enabled OK (python, voila)

Other labextensions (built into JupyterLab)
   app dir: /home/borntobealive/.local/share/jupyter/lab
trungleduc commented 1 year ago

Hi, can you try to downgrade jupyter_server to the 1.x version?

12rambau commented 1 year ago

that was it. Is it voila or the jupyter installation that was too loose on version pin ?