Exporting png image to word with kaleido seems to have stopped working

Hi support,

I’m getting the following Error when I try to create a png image of a plotly graph in a word document using the kaleido engine:

    report = self.get_total_report(params, type_of_calc_list, entity_id)
  File "/home/user/src/app/SheetPileCompression/controller.py", line 558, in get_total_report
    image_for_report=True
  File "/home/user/src/app/applib/use_cases/views_in_sheetpilecompression.py", line 297, in present_result_graph_compression
    return io.BytesIO(fig.to_image(format='png', engine='kaleido', width=1000, height=800, scale=1.0))
  File "/usr/local/lib/python3.7/site-packages/plotly/basedatatypes.py", line 3766, in to_image
    return pio.to_image(self, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/plotly/io/_kaleido.py", line 145, in to_image
    fig_dict, format=format, width=width, height=height, scale=scale
  File "/usr/local/lib/python3.7/site-packages/kaleido/scopes/plotly.py", line 154, in transform
    figure, format=format, width=width, height=height, scale=scale
  File "/usr/local/lib/python3.7/site-packages/kaleido/scopes/base.py", line 293, in _perform_transform
    self._ensure_kaleido()
  File "/usr/local/lib/python3.7/site-packages/kaleido/scopes/base.py", line 182, in _ensure_kaleido
    shell=sys.platform == "win32"
  File "/usr/local/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "/usr/local/lib/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.7/site-packages/kaleido/executable/kaleido'

The filestream io.BytesIO(fig.to_image(format='png', engine='kaleido', width=1000, height=800, scale=1.0)) of a plotly figure always worked for us in the past, but now it seems to fail on downloads that have worked before.

I’ve tried to set the kaleido and plotly package to previous versions, but this does not seem to do the trick.

Any ideas?

Hi Tom,

We are aware of this issue and are looking into it. I will keep you updated.

Issue has been fixed.