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
I am having an issue trying to store plotly image with command:
img = pio.write_image(fig=fig, file=fileName, format="png", width=800, height=500, scale=1, engine="kaleido")
It just hangs forever and cannot do anything.
I honestly do not know if this is plotly or kaleido issue. Funny thing is this only happens when within the Flask route. Same code works fine outside the route. For example, if I run this code:
def saveScreenshot_2(fig, width=800, height=500):
ic("def saveScreenShot_2")
"""Saves a Plotly figure as an image to a temporary file.
Args:
fig: The Plotly figure object.
width: The width of the image in pixels (default: 800).
height: The height of the image in pixels (default: 500).
Returns:
The path to the saved image file.
"""
with tempfile.NamedTemporaryFile(suffix=".png", delete=False) as temp_file:
try:
pio.write_image(fig=fig, format="png", file=temp_file.name, width=width, height=height, engine="kaleido")
ic("after pio.write_image")
return temp_file.name
except Exception as e:
print(f"Error saving image: {e}")
return None
outside the flask route, it works normally, but within flask route, it just hangs:
windows 10,
plotly.version: '5.24.1', kaleido.version: '0.2.1'
The text was updated successfully, but these errors were encountered:
I am having an issue trying to store plotly image with command:
img = pio.write_image(fig=fig, file=fileName, format="png", width=800, height=500, scale=1, engine="kaleido")
It just hangs forever and cannot do anything.
I honestly do not know if this is plotly or kaleido issue. Funny thing is this only happens when within the Flask route. Same code works fine outside the route. For example, if I run this code:
outside the flask route, it works normally, but within flask route, it just hangs:
windows 10,
plotly.version: '5.24.1', kaleido.version: '0.2.1'
The text was updated successfully, but these errors were encountered: