Panel does not show widgets inline with Windows 10 for getting started example

Hi,

I cannot getting the example Build an app — Panel v1.2.1 to run on a windows 10 virtual machine. It does not display any panel widget inline, the output cells stay empty.

However, I can see the widgets in the side panel preview (change the code to call first_app.servable())

I run with Python 3.10.5 (also tried python 3.9) in a virtual enviroment created using virtualenv and installed the packages using pip install.

Pip freeze gives the following output
$ pip freeze
anyio==3.7.1
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
arrow==1.2.3
asttokens==2.2.1
async-lru==2.0.4
attrs==23.1.0
Babel==2.12.1
backcall==0.2.0
beautifulsoup4==4.12.2
bleach==6.0.0
bokeh==3.2.1
certifi==2023.7.22
cffi==1.15.1
charset-normalizer==3.2.0
colorama==0.4.6
colorcet==3.0.1
comm==0.1.3
contourpy==1.1.0
cycler==0.11.0
debugpy==1.6.7
decorator==5.1.1
defusedxml==0.7.1
exceptiongroup==1.1.2
executing==1.2.0
fastjsonschema==2.18.0
fonttools==4.41.1
fqdn==1.5.1
holoviews==1.17.0
hvplot==0.8.4
idna==3.4
ipykernel==6.25.0
ipython==8.14.0
ipywidgets==8.1.0
isoduration==20.11.0
jedi==0.19.0
Jinja2==3.1.2
json5==0.9.14
jsonpointer==2.4
jsonschema==4.18.4
jsonschema-specifications==2023.7.1
jupyter-bokeh==3.0.7
jupyter-events==0.7.0
jupyter-lsp==2.2.0
jupyter_client==8.3.0
jupyter_core==5.3.1
jupyter_server==2.7.0
jupyter_server_terminals==0.4.4
jupyterlab==4.0.3
jupyterlab-pygments==0.2.2
jupyterlab-widgets==3.0.8
jupyterlab_server==2.24.0
kiwisolver==1.4.4
linkify-it-py==2.0.2
Markdown==3.4.4
markdown-it-py==3.0.0
MarkupSafe==2.1.3
matplotlib==3.7.2
matplotlib-inline==0.1.6
mdit-py-plugins==0.4.0
mdurl==0.1.2
mistune==3.0.1
nbclient==0.8.0
nbconvert==7.7.3
nbformat==5.9.2
nest-asyncio==1.5.7
notebook_shim==0.2.3
numpy==1.25.2
overrides==7.3.1
packaging==23.1
pandas==2.0.3
pandocfilters==1.5.0
panel==1.2.1
param==1.13.0
parso==0.8.3
pickleshare==0.7.5
Pillow==10.0.0
platformdirs==3.10.0
prometheus-client==0.17.1
prompt-toolkit==3.0.39
psutil==5.9.5
pure-eval==0.2.2
pycparser==2.21
pyct==0.5.0
Pygments==2.15.1
pyparsing==3.0.9
python-dateutil==2.8.2
python-json-logger==2.0.7
pytz==2023.3
pyviz-comms==2.3.2
pywin32==306
pywinpty==2.0.11
PyYAML==6.0.1
pyzmq==25.1.0
referencing==0.30.0
requests==2.31.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.9.2
Send2Trash==1.8.2
six==1.16.0
sniffio==1.3.0
soupsieve==2.4.1
stack-data==0.6.2
terminado==0.17.1
tinycss2==1.2.1
tomli==2.0.1
tornado==6.3.2
tqdm==4.65.0
traitlets==5.9.0
typing_extensions==4.7.1
tzdata==2023.3
uc-micro-py==1.0.2
uri-template==1.3.0
urllib3==2.0.4
wcwidth==0.2.6
webcolors==1.13
webencodings==0.5.1
websocket-client==1.6.1
widgetsnbextension==4.0.8
xyzservices==2023.7.0

I use Microsoft Edge Version 115.0.1901.188 (Official build) (64-bit)
Also tried with Chrome Version 115.0.5790.110 (Official Build) (64-bit)

The command line shows the following output:
$ jupyter-lab .
[I 2023-08-01 10:59:27.358 ServerApp] Package jupyterlab took 0.0001s to import
[I 2023-08-01 10:59:27.405 ServerApp] Package jupyter_lsp took 0.0466s to import
[W 2023-08-01 10:59:27.405 ServerApp] A _jupyter_server_extension_points function was not found in jupyter_lsp. Instead, a _jupyter_server_extension_paths function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2023-08-01 10:59:27.420 ServerApp] Package jupyter_server_terminals took 0.0210s to import
[I 2023-08-01 10:59:27.420 ServerApp] Package notebook_shim took 0.0000s to import
[W 2023-08-01 10:59:27.420 ServerApp] A _jupyter_server_extension_points function was not found in notebook_shim. Instead, a _jupyter_server_extension_paths function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2023-08-01 10:59:30.015 ServerApp] Package panel.io.jupyter_server_extension took 2.5939s to import
[I 2023-08-01 10:59:30.030 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2023-08-01 10:59:30.030 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2023-08-01 10:59:30.046 ServerApp] jupyterlab | extension was successfully linked.
[I 2023-08-01 10:59:30.703 ServerApp] notebook_shim | extension was successfully linked.
[I 2023-08-01 10:59:30.703 ServerApp] panel.io.jupyter_server_extension | extension was successfully linked.
[I 2023-08-01 10:59:30.781 ServerApp] notebook_shim | extension was successfully loaded.
[I 2023-08-01 10:59:30.796 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2023-08-01 10:59:30.796 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2023-08-01 10:59:30.796 LabApp] JupyterLab extension loaded from C:\Users\tgdmuto2\Documents\python\panel2\venv\lib\site-packages\jupyterlab
[I 2023-08-01 10:59:30.796 LabApp] JupyterLab application directory is C:\Users\tgdmuto2\Documents\python\panel2\venv\share\jupyter\lab
[I 2023-08-01 10:59:30.796 LabApp] Extension Manager is ‘pypi’.
[I 2023-08-01 10:59:30.812 ServerApp] jupyterlab | extension was successfully loaded.
[I 2023-08-01 10:59:30.812 ServerApp] panel.io.jupyter_server_extension | extension was successfully loaded.
[I 2023-08-01 10:59:30.812 ServerApp] Serving notebooks from local directory: C:\Users\tgdmuto2\Documents\python\panel2
[I 2023-08-01 10:59:30.812 ServerApp] Jupyter Server 2.7.0 is running at:
[I 2023-08-01 10:59:30.812 ServerApp] http:xx localhost:8888/lab?token=e4abc599d7fe8662c13a963a825bf1d388c10db93141d8d6
[I 2023-08-01 10:59:30.812 ServerApp] http xx:127.0.0.1:8888/lab?token=e4abc599d7fe8662c13a963a825bf1d388c10db93141d8d6
[I 2023-08-01 10:59:30.812 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2023-08-01 10:59:30.921 ServerApp]

    To access the server, open this file in a browser:
        file:///C:/Users/tgdmuto2/AppData/Roaming/jupyter/runtime/jpserver-11332-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/lab?token=e4abc599d7fe8662c13a963a825bf1d388c10db93141d8d6
        http://127.0.0.1:8888/lab?token=e4abc599d7fe8662c13a963a825bf1d388c10db93141d8d6
[I 2023-08-01 10:59:31.093 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
[W 2023-08-01 10:59:35.089 LabApp] Could not determine jupyterlab build status without nodejs
[I 2023-08-01 10:59:39.578 ServerApp] Kernel started: c12eae1a-5e22-4cc0-ac2d-63b98fde7e7b
[I 2023-08-01 10:59:41.750 ServerApp] Connecting to kernel c12eae1a-5e22-4cc0-ac2d-63b98fde7e7b.

The example code works well on MAC OS.

To troubleshoot I also checked that bokeh plots.
from bokeh.plotting import figure, output_file, output_notebook, show
from bokeh.resources import INLINE
import bokeh.io

bokeh.io.output_notebook(INLINE)
output_notebook()

p = figure()
p.line(x=[1, 2, 3], y=[4,6,2])
show(p)
This worked, but gave a javascript error “jQery is not defined”

When I comment out “bokeh.io.output_notebook(INLINE)” and execute the cell again, the error disappears. However, when I restart the browser, then without the line I only get Javascript Error: timeout without a plot.

Matplotlib plots inline without problems.

I do not know what I could further do.
Can you help me?

Best regards
Torsten

Update: I also have the problem, if I let the jupyter-lab server run on a linux redhat virtual machine on a Citrix and only use the browser from the Windows 10 VM. I tried Chrome, Edge and Firefox.

Hi @torsten,

I sometimes encounter this, I put it down to some package conflict but I’ve never worked out the offender.

So I can’t solve your issue per say, but I can confirm the code works in my fresh setup on windows 10 machine and provide an alternative route. The main difference might be how I installed it all. I followed a slightly different path using miniconda.

miniconda installer

Once I installed the latest miniconda I then ran the following commands in the prompt

conda create --name myuniquename -c pyviz hvplot panel jupyterlab
conda activate myuniquename
jupyter lab

Launches server and opens jupyter lab in edge then I’m able to follow the example with no issues.

1 Like

Only other suggestion I have would be to try clearing the browser cache I sometimes get weird things happening more so after an upgrade though

1 Like

import holoviews as hv

Then, hv.extension('bokeh') after pn.extension()

Also, make sure you have the bokeh jupyter extension installed if you’re on jupyter lab. If it still doesn’t work, check your console output by pressing F12

1 Like

Hi Carl,
thanks, I tried it. Did not help.
Best regards, Torsten

Hi Material-Scientist,

I tried your code changes, but did not help.
In the dev console I recorded the errors in the log.
image

I also need to mention that the virtual machine is behind a company proxy,
so those links in the error messages are indeed not reachable and I cannot make them reachable.

Best regards
Torsten

Update:
The problem seems to be that the the virtual machine is isolated without connection to the internet

I have tried the following: download the javascript files, store them offline and read them using
from IPython.display import Javascript
Javascript(filename=‘someFileName.js’)
While the reading of the files produced no error, it did not solve the problem.
I still see the same errors in the chrome dev environment.

Does anybody have an idea how I could solve the situation?
Is the panel package cabable of working offline?

Can anybody help me?

Best regards
Torsten

Panel can inline resources, either via pn.config.inline=True or the environment variable Panel_Inline. See Config — Panel v1.2.1

Hi Marc,
thanks for your suggestion.

I inserted “pn.config.inline=True”, however, there is no difference.
The same error messages as above appeared.

I also played with
js_files = {‘bokeh’: ‘javascript/bokeh-3.2.1.min.js’,
‘panel’: ‘javascript/panel.min.js’,
‘bokeh-gl’: ‘javascript/bokeh-gl-3.2.1.min.js’,
‘bokeh-widgets’: ‘javascript/bokeh-widgets-3.2.1.min.js’,
‘bokeh-tables’: ‘javascript/bokeh-tables-3.2.1.min.js’,
}
pn.extension(js_files=js_files)
With the javascript directory in the same directory where the jupyter lab runs
Also no success, same error messages.

I also noticed, that the error messages appear directly after opening the ipynb file
in jupyter lab without even executing a cell.

Any other idea what I could do / try?

Best regards
Torsten

Additional info: I noticed that if I clear all cell outputs before opening the jpynb file,
then I get the errors actually during cell execution.

During startup I get

during opening the ipynb file (with cell output deleted)
image

and during notebook execution I get the errors: