Open patrickhoebeke opened 1 year ago
Hi @patrickhoebeke, can you try using voila 0.4.0 with ipywidgets 8?
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
I had the same javascript error show up, however had worked after tweaking with ipywidgets==8.0.2 and nbconvert==7.0.0
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 ?
Hi @trungleduc , thanks for your very quick reaction.
voila 0.4.0
is already installed. I've just installedipywidgets==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.
Hi @patrickhoebeke, I re-created almost similar setup and attaching the sequence of commands and the working screenshot.
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
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.
:-)
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 :
pip freeze > requirements.txt
and use this requirements.txt to install on production.Ah la la ... the fun of programming :-)
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
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!
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?
Damned. I was not aware of this security issue. Thanks for sharing... https://github.com/voila-dashboards/voila/security/advisories/GHSA-2q59-h24c-w6fg
Description
With a fresh install of jupyterlab and voilà, the ipywidgets are not rendered while they are correctly displayed by jupyterlab.
After clicking on it:![image](https://user-images.githubusercontent.com/1043822/206120856-33bcca0f-2f9f-42cb-b11a-fd28d033e292.png)
Reproduce
Step1 : install environment
In a terminal
Step2 : create the following notebook "issue.ipynb" containing the following code:
In a terminal
Open the result in your browser at http://localhost:8866/
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 :
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](https://user-images.githubusercontent.com/1043822/206122644-a0a2d838-80c2-475a-aad7-a3526c76b8c6.png)
I also noticed the following error in the console log of FireFox![image](https://user-images.githubusercontent.com/1043822/206122875-9668e1ef-2210-4143-a620-2413c42a6dfd.png)
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](https://user-images.githubusercontent.com/1043822/206121326-d9e80e5e-28b2-4328-bdb4-5f359aa4282b.png)
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
Command Line Output
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',Browser Output
![image](https://user-images.githubusercontent.com/1043822/206129135-4111dd79-8721-4d79-a9fa-fdafb7a88ff5.png)If using JupyterLab
Installed Labextensions
``` 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) ```