I have never used plotly before, and I have been trying to export a sample image code to png. I have installed plotly and kaleido and ran the code on python 3, but nothing happens.
#Here is the code:
import plotly.express as px
import numpy as np
# RGB Data as numpy array
img_rgb = np.array([[[255, 0, 0], [0, 255, 0], [0, 0, 255]],], dtype=np.uint8)
fig = px.imshow(img_rgb)
fig.show()
fig.write_image("fig.png")
According to the plotly documentation, that should do the trick, but I can't get a png image. It shows no errors, no warnings... it's like python is stuck in an infinite loop. I can't even stop the terminal from running.
I'm using python 3.9.6 64-bit
I have tried plotly latest version (5.3.1) and an older version (4.14.3), but I've got the same problem.
python -m pip install plotly
kaleido is the latest version (0.2.1), but I have tried version (0.2.0) too.
python -m pip install -U kaleido
What could I be doing wrong?
UPDATE: I have tried the same process in another computer, and it worked ok. Any ideas why the first computer won't run the code?