Panel preview gives a GET error for hello world

The panel preview icon for two simple notebooks is not working at all in one case and raising a js console error in both cases. In the screen shot, Untitled1.ipynb is just the first app code and Unitled2.ipynb includes pn.panel("hello").servable(). When I click the panel preview icon, the GET error arises in both cases. Somehow, the hello panel still comes up but the other one does not.

If relevant, I’m forwarding the jupyterlab port over an ssh tunnel.

Versions
aiohttp                   3.9.1
aiosignal                 1.3.1
alembic                   1.13.1
anyio                     4.2.0
argon2-cffi               23.1.0
argon2-cffi-bindings      21.2.0
arrow                     1.3.0
asttokens                 2.4.1
async-generator           1.10
async-lru                 2.0.4
async-timeout             4.0.3
attrs                     23.2.0
Babel                     2.14.0
backcall                  0.2.0
beautifulsoup4            4.12.3
bleach                    6.1.0
bokeh                     3.1.1
certifi                   2023.11.17
certipy                   0.1.3
cffi                      1.16.0
charset-normalizer        3.3.2
click                     8.1.7
cloudpickle               3.0.0
colorama                  0.4.6
comm                      0.2.1
contourpy                 1.1.1
cryptography              41.0.7
dask                      2023.5.0
dask_labextension         7.0.0
debugpy                   1.8.0
decorator                 5.1.1
defusedxml                0.7.1
distributed               2023.5.0
exceptiongroup            1.2.0
executing                 2.0.1
fastjsonschema            2.19.1
fqdn                      1.5.1
frozenlist                1.4.1
fsspec                    2023.12.2
gitdb                     4.0.11
GitPython                 3.1.41
greenlet                  3.0.3
h5grove                   1.3.0
h5py                      3.10.0
idna                      3.6
importlib-metadata        7.0.1
importlib-resources       6.1.1
ipykernel                 6.29.0
ipython                   8.12.3
isoduration               20.11.0
jedi                      0.19.1
Jinja2                    3.1.3
json5                     0.9.14
jsonpointer               2.4
jsonschema                4.21.1
jsonschema-specifications 2023.12.1
jupyter_client            8.6.0
jupyter_core              5.7.1
jupyter-events            0.9.0
jupyter-lsp               2.2.2
jupyter_server            2.12.5
jupyter-server-mathjax    0.2.6
jupyter_server_proxy      4.1.0
jupyter_server_terminals  0.5.1
jupyter-telemetry         0.1.0
jupyterhub                4.0.2
jupyterlab                4.0.11
jupyterlab_geojson        3.4.0
jupyterlab_git            0.50.0
jupyterlab_h5web          11.1.0
jupyterlab_pygments       0.3.0
jupyterlab_server         2.25.2
jupyterlab-widgets        3.0.9
jupytext                  1.16.1
linkify-it-py             2.0.2
locket                    1.0.0
Mako                      1.3.0
Markdown                  3.5.2
markdown-it-py            3.0.0
MarkupSafe                2.1.3
matplotlib-inline         0.1.6
mdit-py-plugins           0.4.0
mdurl                     0.1.2
mistune                   3.0.2
msgpack                   1.0.7
multidict                 6.0.4
nbclient                  0.9.0
nbconvert                 7.14.2
nbdime                    4.0.1
nbformat                  5.9.2
nest-asyncio              1.5.9
notebook                  7.0.7
notebook_shim             0.2.3
numpy                     1.24.4
oauthlib                  3.2.2
orjson                    3.9.12
overrides                 7.4.0
packaging                 23.2
pamela                    1.1.0
pandas                    2.0.3
pandocfilters             1.5.1
panel                     1.2.3
param                     2.0.2
parso                     0.8.3
partd                     1.4.1
pexpect                   4.9.0
pickleshare               0.7.5
pillow                    10.2.0
pip                       23.3.2
pkgutil_resolve_name      1.3.10
platformdirs              4.1.0
prometheus-client         0.19.0
prompt-toolkit            3.0.43
psutil                    5.9.8
ptyprocess                0.7.0
pure-eval                 0.2.2
pycparser                 2.21
Pygments                  2.17.2
pyOpenSSL                 23.3.0
python-dateutil           2.8.2
python-json-logger        2.0.7
pytz                      2023.3.post1
pyviz_comms               3.0.1
PyYAML                    6.0.1
pyzmq                     25.1.2
referencing               0.32.1
requests                  2.31.0
rfc3339-validator         0.1.4
rfc3986-validator         0.1.1
rpds-py                   0.17.1
ruamel.yaml               0.18.5
ruamel.yaml.clib          0.2.8
Send2Trash                1.8.2
setuptools                41.6.0
simpervisor               1.0.0
six                       1.16.0
smmap                     5.0.1
sniffio                   1.3.0
sortedcontainers          2.4.0
soupsieve                 2.5
SQLAlchemy                2.0.25
stack-data                0.6.3
tblib                     3.0.0
terminado                 0.18.0
tifffile                  2023.7.10
tinycss2                  1.2.1
toml                      0.10.2
tomli                     2.0.1
toolz                     0.12.0
tornado                   6.4
tqdm                      4.66.1
traitlets                 5.14.1
types-python-dateutil     2.8.19.20240106
typing_extensions         4.9.0
tzdata                    2023.4
uc-micro-py               1.0.2
uri-template              1.3.0
urllib3                   2.1.0
wcwidth                   0.2.13
webcolors                 1.13
webencodings              0.5.1
websocket-client          1.7.0
xyzservices               2023.10.1
yarl                      1.9.4
zict                      3.0.0
zipp                      3.17.0

There are two environments involved here:

  1. The environment that JupyterLab is running in, which is the environment output you sent.
  2. The environment the notebook kernel is running in (which is what the preview will use).

It sounds like the kernel that Untitled1.ipynb is running in an environment that does not have nbconvert installed which means that Panel cannot convert the notebook into a runnable app.

Thank you for the help, problem resolved! Let me write down what I think I’ve learned about set up for separate jupyterlab and notebook environments.

minimal requirements.txt for jupyterlab environment

  • panel (has requirement: pyviz-comms)
  • jupyterlab (has downstream requirement nbconvert)

minimal requirements.txt for notebook kernel environment

  • panel
  • nbconvert
  • ipykernel

If I’m right, is it possible the documentation is a bit thin here, on two points? The Getting Started > Installation section suggested to me that only pyviz-comms (not panel) is required in the jupyterlab environment. I don’t see anything to indicate the kernel environment would require nbconvert.

I will create an issue if I don’t get corrected here. Thanks, again!

1 Like