| jupyter |
|
|---|
Plotly.py 6.1 introduces support for Kaleido v1, which improves static image generation for Plotly figures.
While adding support for Kaleido v1, we are deprecating support for earlier versions of Kaleido and support for Orca. Support for Orca and earlier versions of Kaleido will be removed after September 2025, and we recommend updating to the latest Kaleido. This page documents how to migrate your Plotly code to Kaleido v1 and outlines the changes in functionality.
To migrate from either Orca or Kaleido v0, first install the latest Kaleido with:
pip install --upgrade kaleidoKaleido uses Chrome for static image generation. Versions of Kaleido prior to v1 included Chrome as part of the Kaleido package. Kaleido v1 does not include Chrome; instead, it looks for a compatible version of Chrome (or Chromium) already installed on the machine on which it's running.
See the Chrome section on the Static Image Export page for more details on Chome and Kaleido.
The engine parameter on static image export methods and functions is deprecated in Plotly.py 6.2 and will be removed after September 2025. Once the engine parameter is removed, static image generation will use Kaleido v1 if it's installed, or raise an error if it isn't.
You'll need to update your code to remove references to engine. For example, fig.to_image(format="png", engine="orca") or fig.to_image(format="png", engine="kaleido") needs to be updated to fig.to_image(format="png"). This change applies to: fig.to_image, fig.write_image, plotly.io.to_image, and plotly.io.write_image.
The eps format is no longer supported in Kaleido v1. If your existing code sets format="eps", you'll need to update it to use another format, for example pdf.
Accessing Kaleido defaults and config settings via plotly.io.kaleido.scope is now deprecated and will be removed after September 2025. You'll need to update any code that uses plotly.io.kaleido.scope to instead use plotly.io.defaults. For example, to set the default_format to "jpeg":
import plotly.io as pio
pio.defaults.default_format = "jpeg"
# Instead of:
# pio.kaleido.scope.default_format = "jpeg"The mapbox_access_token config setting is not available on plotly.io.defaults because Mapbox maps are deprecated and will be removed in a future version of Plotly.py. See MapLibre Migration for more details.
If you are migrating from Orca, the following config settings do not apply to Kaleido: server_url, port, timeout, and use_xvfb, but other settings, such as default_format, can be accessed via plotly.io.defaults.
Plotly.py 6.1 includes a write_images function (plotly.io.write_images), which we recommend over write_image when exporting more than one figure. Calling write_images with a list of figures (or dicts representing figures) to export provides better performance than multiple calls with write_image. See the Write Multiple Images section for more details.