plotly / Kaleido

Fast static image export for web-based visualization libraries with zero dependencies
MIT License
378 stars 38 forks source link

`setDaemon()` Deprecation warning for `to_image` #194

Open huonw opened 6 months ago

huonw commented 6 months ago

If one executes to_image with Python 3.10 or greater, there is deprecation warning about setDaemon:

from plotly.graph_objs import Figure
Figure().to_image()
.../.venv/lib/python3.10/site-packages/kaleido/scopes/base.py:188: DeprecationWarning:

setDaemon() is deprecated, set the daemon attribute instead

This appears when warnings are enabled, such as python -W default ... or running tests under pytest.

All-in-one reproducer:

# do it all in a temporary directory/venv
cd $(mktemp -d)
python3.10 -m venv .venv

# install all dependencies
.venv/bin/python -m pip install kaleido==0.2.1 plotly==5.21.0 tenacity==8.2.3 packaging==24.0

# BUG: run to_image, with warnings enabled:
.venv/bin/python -W default -c 'from plotly.graph_objs import Figure; Figure().to_image()'
# DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead

Based on https://github.com/plotly/Kaleido/issues/171, this can probably be resolved by doing a new release of Kaleido to PyPI & conda, since https://github.com/plotly/Kaleido/pull/146 appears to fix it in the unreleased code on the master branch.

Alternatively, if Kaleido is unmaintained (and thus may stop working with future Python versions), maybe Plotly.py needs to support another engine?

Thanks for Plotly!

gvwilson commented 3 months ago

Thanks for your interest in Kaleido. We are currently working on an overhaul that might address your issue - we hope to have news in a few weeks and will post an update then. Thanks - @gvwilson

thijssnelleman commented 3 weeks ago

Any update on this issue?

jkittner commented 1 week ago

This seems to be a duplicate of #171 and was resolved by #146

ayjayt commented 1 week ago

Hi everyone, I'll add this to my watch. I think the new major release is coming around tomorrow. We're doing our best to squash all bugs and improve debugging before that release.

The new release of kaleido is a bit different because for many reasons, but majorly, it no longer bundles chrome.