7

I am trying to save a simple plotly figure to a directory. I understand it needs kaleido (I have version '0.2.1') and also at least plotly '5.3.1' which are installed.

However trying to save the image I get the following error:

fig.write_image(path)

ValueError: 
Image export using the "kaleido" engine requires the kaleido package,
which can be installed using pip:
$ pip install -U kaleido

Why is this occuring when all the required packages are there?

geds133
  • 1,503
  • 5
  • 20
  • 52

3 Answers3

4

I've got exactly the same issue on google colab. Even after installation kaleido, the same error. Accidentally I've found fix, it seems necesarry to import kaleido first:

!pip install kaleido
import kaleido #required
kaleido.__version__ #0.2.1

import plotly
plotly.__version__ #5.5.0

#now this works:
import plotly.graph_objects as go

fig = go.Figure()
fig.write_image('aaa.png')
Quant Christo
  • 1,275
  • 9
  • 23
1

Got this exact issue on colab and tried all options but didn't work. Then, found out that if you revert Plotly to version 5.3.1, the issue goes away. Not the best fix, but was the only thing that worked for me.

!pip uninstall ploty !pip install plotly==5.3.1 import plotly import kaleido

Enoch YU
  • 11
  • 1
0

The transition from Orca to Kaleido is not without speed bumps.

For users on Windows 10 and 11, users seem to have luck rolling back to Kaleido version 0.1.0, see. https://github.com/plotly/Kaleido/issues/110

MvZ
  • 231
  • 1
  • 5