Skip to content

Unable to serve panel notebooks with voila #1367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pthien opened this issue May 24, 2020 · 3 comments
Closed

Unable to serve panel notebooks with voila #1367

pthien opened this issue May 24, 2020 · 3 comments

Comments

@pthien
Copy link

pthien commented May 24, 2020

I have read that deploying panel apps through voila is supported and am attempting to deploy some of the example panel notebooks without success.

If I take the save_filtered_df example notebook and without modifying it run the below, then I can see the interface, however it does not respond to user input. i.e, if I move the slider, it does not update the table.

voila save_filtered_df.ipynb --enable_nbextensions=True

If I modify the notebook by changing

pn.extension()

to

pn.extension(comms='ipywidgets')

as stated in the Deploy and Export section of the documentation, then the page is completely blank - none of the controls are visible.
If I then add a print() statement or a markdown cell, the that is visible, but any panel ipywidget is not displayed.

ALL software version info

Below is the output of conda list from my conda environment.

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                      1_llvm    conda-forge
async_generator           1.10                       py_0    conda-forge
attrs                     19.3.0                     py_0    conda-forge
backcall                  0.1.0                      py_0    conda-forge
binutils_impl_linux-64    2.34                 h53a641e_2    conda-forge
bleach                    3.1.5              pyh9f0ad1d_0    conda-forge
bokeh                     2.0.1            py38h32f6830_0    conda-forge
brotlipy                  0.7.0           py38h1e0a361_1000    conda-forge
ca-certificates           2020.4.5.1           hecc5488_0    conda-forge
certifi                   2020.4.5.1       py38h32f6830_0    conda-forge
cffi                      1.14.0           py38hd463f26_0    conda-forge
chardet                   3.0.4           py38h32f6830_1006    conda-forge
click                     7.1.2              pyh9f0ad1d_0    conda-forge
cloudpickle               1.4.1                      py_0    conda-forge
colorcet                  2.0.2                      py_0    pyviz
cryptography              2.9.2            py38h766eaa4_0    conda-forge
cycler                    0.10.0                     py_2    conda-forge
cytoolz                   0.10.1           py38h516909a_0    conda-forge
dask                      2.16.0                     py_0    conda-forge
dask-core                 2.16.0                     py_0    conda-forge
datashader                0.10.0                     py_0    pyviz
datashape                 0.5.4                      py_1    conda-forge
dbus                      1.13.6               he372182_0    conda-forge
decorator                 4.4.2                      py_0    conda-forge
defusedxml                0.6.0                      py_0    conda-forge
distributed               2.16.0           py38h32f6830_0    conda-forge
entrypoints               0.3             py38h32f6830_1001    conda-forge
expat                     2.2.9                he1b5a44_2    conda-forge
fontconfig                2.13.1            h86ecdb6_1001    conda-forge
freetype                  2.10.2               he06d7ca_0    conda-forge
fsspec                    0.7.4                      py_0    conda-forge
gcc_impl_linux-64         7.5.0                hd420e75_6    conda-forge
gettext                   0.19.8.1          hc5be6a0_1002    conda-forge
gfortran_impl_linux-64    7.5.0                hdf63c60_6    conda-forge
glib                      2.64.2               h6f030ca_1    conda-forge
gst-plugins-base          1.14.5               h0935bb2_2    conda-forge
gstreamer                 1.14.5               h36ae1b5_2    conda-forge
gxx_impl_linux-64         7.5.0                hdf63c60_6    conda-forge
heapdict                  1.0.1                      py_0    conda-forge
holoviews                 1.13.2                     py_0    pyviz
hvplot                    0.5.2                      py_0    pyviz
icu                       64.2                 he1b5a44_1    conda-forge
idna                      2.9                        py_1    conda-forge
imagecodecs-lite          2019.12.3        py38h1e0a361_0    conda-forge
imageio                   2.8.0                      py_0    conda-forge
importlib-metadata        1.6.0            py38h32f6830_0    conda-forge
importlib_metadata        1.6.0                         0    conda-forge
ipykernel                 5.3.0            py38h23f93f0_0    conda-forge
ipython                   7.14.0           py38h32f6830_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.5.1                      py_0    conda-forge
jedi                      0.17.0           py38h32f6830_0    conda-forge
jinja2                    2.11.2             pyh9f0ad1d_0    conda-forge
jpeg                      9c                h14c3975_1001    conda-forge
json5                     0.9.0                      py_0    conda-forge
jsonschema                3.2.0            py38h32f6830_1    conda-forge
jupyter                   1.0.0                      py_2    conda-forge
jupyter_bokeh             2.0.2                      py_0    bokeh
jupyter_client            6.1.3                      py_0    conda-forge
jupyter_console           6.1.0                      py_1    conda-forge
jupyter_core              4.6.3            py38h32f6830_1    conda-forge
jupyter_server            0.1.1                    py38_0    conda-forge
jupyterlab                2.1.3                      py_0    conda-forge
jupyterlab_pygments       0.1.1              pyh9f0ad1d_0    conda-forge
jupyterlab_server         1.1.5                      py_0    conda-forge
kiwisolver                1.2.0            py38hbf85e49_0    conda-forge
ld_impl_linux-64          2.34                 h53a641e_2    conda-forge
libblas                   3.8.0               16_openblas    conda-forge
libcblas                  3.8.0               16_openblas    conda-forge
libclang                  9.0.1           default_hde54327_0    conda-forge
libffi                    3.2.1             he1b5a44_1007    conda-forge
libgcc-ng                 9.2.0                h24d8f2e_2    conda-forge
libgfortran-ng            7.5.0                hdf63c60_6    conda-forge
libgomp                   9.2.0                h24d8f2e_2    conda-forge
libiconv                  1.15              h516909a_1006    conda-forge
liblapack                 3.8.0               16_openblas    conda-forge
libllvm8                  8.0.1                hc9558a2_0    conda-forge
libllvm9                  9.0.1                he513fc3_1    conda-forge
libopenblas               0.3.9                h5ec1e0e_0    conda-forge
libpng                    1.6.37               hed695b0_1    conda-forge
libsodium                 1.0.17               h516909a_0    conda-forge
libstdcxx-ng              9.2.0                hdf63c60_2    conda-forge
libtiff                   4.1.0                hc7e4089_6    conda-forge
libuuid                   2.32.1            h14c3975_1000    conda-forge
libuv                     1.34.0               h516909a_0    conda-forge
libwebp-base              1.1.0                h516909a_3    conda-forge
libxcb                    1.13              h14c3975_1002    conda-forge
libxkbcommon              0.10.0               he1b5a44_0    conda-forge
libxml2                   2.9.10               hee79883_0    conda-forge
llvm-openmp               10.0.0               hc9558a2_0    conda-forge
llvmlite                  0.32.0           py38h4f45e52_0    conda-forge
locket                    0.2.0                      py_2    conda-forge
lz4-c                     1.9.2                he1b5a44_1    conda-forge
markdown                  3.2.2                      py_0    conda-forge
markupsafe                1.1.1            py38h1e0a361_1    conda-forge
matplotlib                3.2.1                         0    conda-forge
matplotlib-base           3.2.1            py38h2af1d28_0    conda-forge
mistune                   0.8.4           py38h1e0a361_1001    conda-forge
msgpack-python            1.0.0            py38hbf85e49_1    conda-forge
multipledispatch          0.6.0                      py_0    conda-forge
nbconvert                 5.6.1            py38h32f6830_1    conda-forge
nbformat                  5.0.6                      py_0    conda-forge
ncurses                   6.1               hf484d3e_1002    conda-forge
networkx                  2.4                        py_1    conda-forge
nodejs                    13.13.0              hf5d1a2b_0    conda-forge
notebook                  6.0.3            py38h32f6830_0    conda-forge
nspr                      4.25                 he1b5a44_0    conda-forge
nss                       3.47                 he751ad9_0    conda-forge
numba                     0.49.1           py38hcb8c335_0    conda-forge
numpy                     1.17.5           py38h95a1406_0    conda-forge
olefile                   0.46                       py_0    conda-forge
openssl                   1.1.1g               h516909a_0    conda-forge
packaging                 20.4               pyh9f0ad1d_0    conda-forge
pandas                    1.0.3            py38hcb8c335_1    conda-forge
pandoc                    2.9.2.1                       0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
panel                     0.9.5                      py_0    pyviz
param                     1.9.3                      py_0    pyviz
parso                     0.7.0              pyh9f0ad1d_0    conda-forge
partd                     1.1.0                      py_0    conda-forge
pcre                      8.44                 he1b5a44_0    conda-forge
pexpect                   4.8.0            py38h32f6830_1    conda-forge
pickleshare               0.7.5           py38h32f6830_1001    conda-forge
pillow                    7.1.2            py38h9776b28_0    conda-forge
pip                       20.1.1             pyh9f0ad1d_0    conda-forge
prometheus_client         0.7.1                      py_0    conda-forge
prompt-toolkit            3.0.5                      py_0    conda-forge
prompt_toolkit            3.0.5                         0    conda-forge
psutil                    5.7.0            py38h1e0a361_1    conda-forge
pthread-stubs             0.4               h14c3975_1001    conda-forge
ptyprocess                0.6.0                   py_1001    conda-forge
pycparser                 2.20                       py_0    conda-forge
pyct                      0.4.6                      py_0    pyviz
pyct-core                 0.4.6                      py_0    pyviz
pygments                  2.6.1                      py_0    conda-forge
pyopenssl                 19.1.0                     py_1    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyqt                      5.12.3           py38ha8c2ead_3    conda-forge
pyqt5-sip                 4.19.18                  pypi_0    pypi
pyqtchart                 5.12                     pypi_0    pypi
pyqtwebengine             5.12.1                   pypi_0    pypi
pyrsistent                0.16.0           py38h1e0a361_0    conda-forge
pysocks                   1.7.1            py38h32f6830_1    conda-forge
python                    3.8.2           he5300dc_7_cpython    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python_abi                3.8                      1_cp38    conda-forge
pytz                      2020.1             pyh9f0ad1d_0    conda-forge
pyviz_comms               0.7.4                      py_0    pyviz
pywavelets                1.1.1            py38h8790de6_1    conda-forge
pyyaml                    5.3.1            py38h1e0a361_0    conda-forge
pyzmq                     19.0.1           py38ha71036d_0    conda-forge
qt                        5.12.5               hd8c4c69_1    conda-forge
qtconsole                 4.7.4              pyh9f0ad1d_0    conda-forge
qtpy                      1.9.0                      py_0    conda-forge
readline                  8.0                  hf8c457e_0    conda-forge
requests                  2.23.0             pyh8c360ce_2    conda-forge
scikit-image              0.17.2           py38hcb8c335_0    conda-forge
scipy                     1.4.1            py38h18bccfc_3    conda-forge
send2trash                1.5.0                      py_0    conda-forge
setuptools                46.4.0           py38h32f6830_0    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
sortedcontainers          2.1.0                      py_0    conda-forge
sqlite                    3.30.1               hcee41ef_0    conda-forge
sysroot_linux-64          2.12                 h3a0023d_3    conda-forge
tblib                     1.6.0                      py_0    conda-forge
terminado                 0.8.3            py38h32f6830_1    conda-forge
testpath                  0.4.4                      py_0    conda-forge
tifffile                  2020.5.11                  py_0    conda-forge
tk                        8.6.10               hed695b0_0    conda-forge
toolz                     0.10.0                     py_0    conda-forge
tornado                   6.0.4            py38h1e0a361_1    conda-forge
tqdm                      4.46.0             pyh9f0ad1d_0    conda-forge
traitlets                 4.3.3            py38h32f6830_1    conda-forge
typing_extensions         3.7.4.2                    py_0    conda-forge
urllib3                   1.25.9                     py_0    conda-forge
voila                     0.1.21                     py_0    conda-forge
wcwidth                   0.1.9              pyh9f0ad1d_0    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.34.2                     py_1    conda-forge
widgetsnbextension        3.5.1                    py38_0    conda-forge
xarray                    0.15.1                     py_0    conda-forge
xorg-libxau               1.0.9                h14c3975_0    conda-forge
xorg-libxdmcp             1.1.3                h516909a_0    conda-forge
xz                        5.2.5                h516909a_0    conda-forge
yaml                      0.2.4                h516909a_0    conda-forge
zeromq                    4.3.2                he1b5a44_2    conda-forge
zict                      2.0.0                      py_0    conda-forge
zipp                      3.1.0                      py_0    conda-forge
zlib                      1.2.11            h516909a_1006    conda-forge
zstd                      1.4.4                h6597ccf_3    conda-forge

Description of expected behavior and the observed behavior

Observed behaviour:

  • Panel controls are not displayed

Expected behaviour:

  • Panel controls are displayed, and interacting with them updates the page contents.

Complete, minimal, self-contained example code that reproduces the issue

Example code after modifying the notebook to wrap everything as an ipywidget

import panel as pn

from bokeh.sampledata.autompg import autompg
from io import StringIO

pn.extension(comms='ipywidgets') 

years = pn.widgets.MultiChoice(
    name='Years', options=list(autompg.yr.unique()), margin=(0, 20, 0, 0)
)
mpg = pn.widgets.RangeSlider(
    name='Mile per Gallon', start=autompg.mpg.min(), end=autompg.mpg.max()
)

@pn.depends(years, mpg)
def filtered_mpg(yrs, mpg):
    df = autompg
    if years.value:
        df = autompg[autompg.yr.isin(yrs)]
    return df[(df.mpg >= mpg[0]) & (df.mpg <= mpg[1])]

@pn.depends(years, mpg)
def filtered_file(yr, mpg):
    df = filtered_mpg(yr, mpg)
    sio = StringIO()
    df.to_csv(sio)
    sio.seek(0)
    return sio

fd = pn.widgets.FileDownload(
    callback=filtered_file, filename='filtered_autompg.csv'
)

pn.Column(pn.Row(years, mpg), fd, pn.panel(filtered_mpg, width=600), width=600)

@nitrocalcite
Copy link

FWIW I had the same behavior until I switched to JupyterLab, not classic notebook - I don't think is in the panel docs, but it is in the jupyter_bokeh docs. (still having other problems though...)

@MarcSkovMadsen
Copy link
Collaborator

I cannot get Voila working either% c.f #2241

@philippjfr
Copy link
Member

Since this was working and then regressed I'll close this in favor of the more recent issue #2351

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

No branches or pull requests

4 participants