holoviz / pyviz_comms

Bidirectional communication for the HoloViz ecosystem
BSD 3-Clause "New" or "Revised" License
32 stars 16 forks source link

Pyviz jupyterlab extension prevents panels to show when served inside a notebook via `app()` #58

Closed joelostblom closed 4 years ago

joelostblom commented 4 years ago

The pyviz jupyterlab extension seem to prevent displaying panels via .app() inside both JupyterLab and the classic notebook. To reproduce, create a new conda environment and install the following:

conda install -c pyviz panel
conda install -c conda-forge jupyterlab
jupyter labextension install @pyviz/jupyterlab_pyviz

Then I tried running:

import panel as pn
pn.extension()
im1 = 'https://upload.wikimedia.org/wikipedia/commons/3/39/PNG_demo_heatmap_Banana.png'
pn.panel(im1)

which shows up fine. However, trying to show the server inside the notebook via .app() does not work:

pn.panel(im1).app('localhost:8888')

The output is just <bokeh.server.server.Server at 0x7fcd45f3e0d0>, but the panel does not display.

When I create another conda environment and don't install the pyviz jupyterlab extension, the bokeh server shows as expected inside the notebook. Is the pyviz extension not needed anymore and can I safely run jupyterlab without it, or might I run into unexpected problems?

I tried in Firefox and without extension in Chromium. Package versions in both environments:

-----
bokeh       2.0.1
panel       0.9.5
-----
IPython             7.14.0
jupyter_client      6.1.2
jupyter_core        4.6.3
jupyterlab          2.1.3
notebook            6.0.3
-----
Python 3.8.2 | packaged by conda-forge | (default, Apr 24 2020, 08:20:52) [GCC 7.3.0]
Linux-5.6.13-arch1-1-x86_64-with-glibc2.10
4 logical CPU cores
-----
Session information updated at 2020-05-23 11:17

(I'm trying this as a workaround for https://discourse.holoviz.org/t/how-can-i-replace-part-of-a-panel-via-a-selection-change-in-a-bokeh-figure/701 so any input there is appreciated as well)

philippjfr commented 4 years ago

Will try to fix this tomorrow.

philippjfr commented 4 years ago

Fixed in @pyviz/jupyterlab_pyviz 1.0.4

joelostblom commented 4 years ago

Thanks for the super quick fix!