Forums

Plotly Kaleido Help

I am trying to use Kaleido to save a png of my plotly graph from my flask application. When I run the following command:

  fig.write_image("/path/to/static/folder")

I get the following errors:

File "/usr/lib/python3.8/site-packages/plotly/basedatatypes.py", line 2817, in write_image

    return pio.write_image(self, *args, **kwargs)

  File "/usr/lib/python3.8/site-packages/plotly/io/_orca.py", line 1704, in write_image

    img_data = to_image(

  File "/usr/lib/python3.8/site-packages/plotly/io/_orca.py", line 1482, in to_image

    ensure_server()

  File "/usr/lib/python3.8/site-packages/plotly/io/_orca.py", line 1344, in ensure_server

    validate_executable()

  File "/usr/lib/python3.8/site-packages/plotly/io/_orca.py", line 1032, in validate_executable

    raise ValueError(

ValueError:

The orca executable is required to export figures as static images,

but it could not be found on the system path.

**NO MATCH**

Searched for executable 'orca' on the following path:

    /home/Lynkon/.local/bin

    /usr/local/bin

    /usr/bin

    /bin

**NO MATCH**

If you haven't installed orca yet, you can do so using conda as follows:

**NO MATCH**

    $ conda install -c plotly plotly-orca

**NO MATCH**

Alternatively, see other installation methods in the orca project README at

https://github.com/plotly/orca.

**NO MATCH**

After installation is complete, no further configuration should be needed.

**NO MATCH**

If you have installed orca, then for some reason plotly.py was unable to

locate it. In this case, set the `plotly.io.orca.config.executable`

property to the full path of your orca executable. For example:

**NO MATCH**

    >>> plotly.io.orca.config.executable = '/path/to/orca'

**NO MATCH**

After updating this executable property, try the export operation again.
If it is successful then you may want to save this configuration so that it
will be applied automatically in future sessions. You can do this as follows:

**NO MATCH**

    >>> plotly.io.orca.config.save()

**NO MATCH**

If you're still having trouble, feel free to ask for help on the forums at

https://community.plot.ly/c/api/python

**NO MATCH**

I understand Orca is an older way to get static images from plotly graphs. Is there a way to more explicitly use Kaleido? I have installed Kaleido using 'pip install -U Kaleido' in my bash console.

Thank you for any help.

[formatted by admin]

Make sure you installed the package for the same Python version your web app runs. See: https://help.pythonanywhere.com/pages/InstallingNewModules/.

I have tried installing with the same version and I still get the same orca error.

If an older version of plotly requires orca, perhaps you need to upgrade the version of plotly that you're using.

No luck either. I have the latest plotly 5.1.0 and the error persists.

If you're still getting the same messge referring to /usr/lib/python3.8/site-packages/plotly/io/_orca.py, then you have not updated plotly because you are still using the pre-installed plotly for Python 3.8. See the link posted by pafk earlier and make sure that you install the module into the version of Python that you're using.

I have tried doing "pip3.8 install --user plotly==5.1.0"

I solved the issue, thank you! I was not updating plotly properly as you said. Using the following solved the problem:

"pip3.8 install --user plotly -U"

Thanks again for the help.