You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to get through micropip.install and import, but then calling px.bar fails with:
Python exception:
Traceback (most recent call last):
File "/lib/python3.9/site-packages/plotly/io/_renderers.py", line 530, in <module>
webbrowser.get()
AttributeError: module 'webbrowser' has no attribute 'get'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/lib/python3.9/site-packages/plotly/basedatatypes.py", line 810, in _repr_html_
bundle = self._repr_mimebundle_()
File "/lib/python3.9/site-packages/plotly/basedatatypes.py", line 822, in _repr_mimebundle_
renderer_str = pio.renderers.default
File "/lib/python3.9/site-packages/_plotly_utils/importers.py", line 36, in __getattr__
class_module = importlib.import_module(rel_module, parent_name)
File "/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 855, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/lib/python3.9/site-packages/plotly/io/_renderers.py", line 532, in <module>
except webbrowser.Error:
AttributeError: module 'webbrowser' has no attribute 'Error'
It looks like there was some work into Jupyterlite to support Plotly, I would like to also support it in Starboard of course :). They seem to load a specific extension like you mentioned (this seems to be the PR: jupyterlite/jupyterlite#129). I am sure we can support it without needing to have the ability to support these kinds of extensions.
I think the next step here is to mock out ipython, the alternative would be to request a patch into plotly.js itself to support custom pyodide environments better, or monkeypatch it ourselves (not a fan!).
Sample notebook: https://starboard.gg/nb/nf9YixM
Just one cell:
It seems to get through
micropip.install
andimport
, but then callingpx.bar
fails with:Here's the same notebook in jupyterlite; the plot renders successfully: https://runsascoded.com/jupyter/lite/retro/notebooks/?path=plotly-test.ipynb
I see a couple mentions of
plotly
in the"federated_extensions"
and"piplite_urls"
sections of jupyterlite/examples/jupyter_lite_config.json, I guess there's some configuration that lets plotly work "out of the box" in the jupyterlite demos, that could be adapted here?The text was updated successfully, but these errors were encountered: