Static image export hangs using kaleido?

I want to get the static image using write_image method, but the program hangs. I have tried severvel method:
1) pio.kaleido.scope.mathjax = None
2) use kaleido 0.1.0 , 0.2.0, 0.0.3 version
but all of them don’t help.

my setup are:
plotly: 5.10.0
kaleido: 0.2.1

the same code in windows runs normally.

test code:

import as px
import numpy as np
img_rgb = np.array([[[255, 0, 0], [0, 255, 0], [0, 0, 255]],], dtype=np.uint8)
fig = px.imshow(img_rgb)
fig.write_image("fig.png", engine="kaleido")

are there someone know why?

hi @whaleprince
:wave: Welcome to the community.

Have you seen this topic? It might have the solution.

Thank you for your reply, I have tried the method in this topic, but nothing changes. And my OS is centos-7, not windows.

Hello, if my linux server doesn’t have graphics card, can the kaleido work normally?

hi @whaleprince
if you’re not using any WebGL, it should work.