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
For some reason plotly/package_data/widgetbundle.js is not being generated. I guess something goes wrong in the build script in js/package.json. Without the presence of that file, the global variable BaseFigureWidget._esm holds an invalid path, which leads to a somewhat surprising bug when using FigureWidget:
During import the function __getattr__ in graph_objects/__init__.py is being called and __init_subclass__ of AnyWidget is being invoked. Due to the missing file a FileNotFoundError is being raised (File not found: /usr/lib/python3.13/site-packages/plotly/package_data/widgetbundle.js).
inside __getattr__ there is a try block containing the import. I assume the intended usage of the try block is to catch any ImportErrors, since the except block will import a dummy-FigureWidget from missing_anywidget which just generates an error about a missing dependency.
However, the except block catches any exception, including the FileNotFoundError. This results in the user getting a misleading error message about a missing dependency (regardless whether that dependency is present or not). The actual fix would be to have the file plotly/package_data/widgetbundle.js present in the library.
The text was updated successfully, but these errors were encountered:
For some reason
plotly/package_data/widgetbundle.js
is not being generated. I guess something goes wrong in the build script injs/package.json
. Without the presence of that file, the global variableBaseFigureWidget._esm
holds an invalid path, which leads to a somewhat surprising bug when using FigureWidget:During import the function
__getattr__
ingraph_objects/__init__.py
is being called and__init_subclass__
ofAnyWidget
is being invoked. Due to the missing file aFileNotFoundError
is being raised (File not found: /usr/lib/python3.13/site-packages/plotly/package_data/widgetbundle.js
).inside
__getattr__
there is a try block containing the import. I assume the intended usage of the try block is to catch any ImportErrors, since the except block will import a dummy-FigureWidget frommissing_anywidget
which just generates an error about a missing dependency.However, the except block catches any exception, including the
FileNotFoundError
. This results in the user getting a misleading error message about a missing dependency (regardless whether that dependency is present or not). The actual fix would be to have the fileplotly/package_data/widgetbundle.js
present in the library.The text was updated successfully, but these errors were encountered: