Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.7k
Open
Description
The issue is that plotly's template system has a circular import dependency:
plotly.graph_objs.__init__.py
imports all trace types including Heatmapgl- During this import process, it also loads template data
layout/template/data/_heatmapgl.py
tries toimport Heatmapgl from plotly.graph_objs
- But plotly.graph_objs is still in the process of being imported!
This occurred when attempting to use plotly and plotly-resampler and a heatmap.
Reproduction of Error
Minimal reproduction code:
importplotly.graph_objsasgogo.Heatmapgl()# ✅ Success# But this fails:fromplotly_resamplerimportFigureResamplerfig=FigureResampler(go.Figure())# ❌ Circular import
Versions affected:
plotly==5.24.1
plotly-resampler==0.10.0
Work around
This can be worked around by forcing import order:
importplotly.graph_objs# Force full initialization firstfromplotly_resamplerimportFigureResampler# Then import resampler