Panel not interactive in web browser

Using panel and hvplot in jupyter notebook. Interactions work fine in notebook - widgets update, including slider, selecting new data elements as input, and toggling trend line using checkbox. These interactions do not work when panel is exported as html and viewed in browser locally. Reset, box zoom, etc. controls do work in browser.

I found comment here (How to Create a Beautiful Python Visualization Dashboard With Panel/Hvplot - YouTube) that panel must be installed in base environment for interactions to work.

Does it require nbconvert command (python - How to export current notebook in HTML on Jupyter - Stack Overflow)? Errors from running the notebook with nbconvert command are copied below.

import os
os.system(‘jupyter nbconvert --to html panel_bwhdpath.ipynb’)

I’ve searched for and tried solutions days. Suggestions?

MacBook Pro, MacOS 12.6.1. Not using conda/anaconda.

Thanks.

Errors:
%opts magic unavailable (pyparsing cannot be imported)
%compositor magic unavailable (pyparsing cannot be imported)
[NbConvertApp] Converting notebook panel_bwhdpath.ipynb to html
/Users/milstone/opt/panel/lib/python3.8/site-packages/nbconvert/filters/widgetsdatatypefilter.py:72: UserWarning: Your element with mimetype(s) dict_keys([]) is not able to be represented.
warn(
/Users/milstone/opt/panel/lib/python3.8/site-packages/nbconvert/filters/widgetsdatatypefilter.py:72: UserWarning: Your element with mimetype(s) dict_keys([]) is not able to be represented.
warn(
/Users/milstone/opt/panel/lib/python3.8/site-packages/nbconvert/filters/widgetsdatatypefilter.py:72: UserWarning: Your element with mimetype(s) dict_keys([]) is not able to be represented.
warn(
[NbConvertApp] Writing 689494 bytes to panel_bwhdpath.html

@enotslim , some types of interactions require a live python kernel to run. It depends on what you are trying to do. A few options:

  • Use jslink or jscallback because all browsers support JavaScript
  • Use the embed functionality to embed states
  • Use Pyodide
  • Serve the panel objects so they are live
1 Like