Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plotly.write_image fails to find Kaleido executable #210

Open
augustebaum opened this issue Oct 24, 2024 · 1 comment
Open

plotly.write_image fails to find Kaleido executable #210

augustebaum opened this issue Oct 24, 2024 · 1 comment
Labels

Comments

@augustebaum
Copy link

Versions:

  • plotly: 5.24.1
  • Kaleido: 0.2.1

To reproduce:

import plotly.graph_objects as go
fig = go.Figure()
fig.write_image('test.png')

I get the error:

FileNotFoundError: [Errno 2] No such file or directory: '/my/project/.venv/lib/python3.12/site-packages/kaleido/executable/kaleido'

which is true: in my filesystem the executable is installed as

/my/project/.venv/lib/python3.12/site-packages/kaleido/executable/bin/kaleido

(note the /bin)

@gvwilson
Copy link
Collaborator

@augustebaum we are prototyping a completely new version of Kaleido that may resolve some of these issues - if you'd like to help us test it out on your platform, please email me ([email protected]) and I'll point you in the right direction. thanks - @gvwilson

@gvwilson gvwilson transferred this issue from plotly/plotly.py Oct 24, 2024
@ayjayt ayjayt added the active label Oct 25, 2024
augustebaum added a commit to probabl-ai/skore that referenced this issue Oct 29, 2024
This is a quick fix to address #594.

In the end, I took a screenshot manually (by using the "Download plot as png" button of the Plotly widget) and displayed it with matplotlib.

Here are all the alternatives I considered, and what didn't work with them:
- Use SVG instead of PNG
	- For that, I'd need to use Plotly's `fig.write_image`, and the library that Plotly uses for this, Kaleido, is currently broken: plotly/Kaleido#210
- Export plotly figure to a file during the example and read it 
	- For that I also need Plotly's `fig.write_image`
- Use Pillow for displaying, instead of matplotlib (which is not really made for that)
	- Only matplotlib is supported by sphinx-gallery, the library that renders the examples
augustebaum added a commit to probabl-ai/skore that referenced this issue Oct 29, 2024
This is a quick fix to address #594.

In the end, I took a screenshot manually (by using the "Download plot as png" button of the Plotly widget) and displayed it with matplotlib.

Here are all the alternatives I considered, and what didn't work with them:
- Use SVG instead of PNG
	- For that, I'd need to use Plotly's `fig.write_image`, and the library that Plotly uses for this, Kaleido, is currently broken: plotly/Kaleido#210
- Export plotly figure to a file during the example and read it 
	- For that I also need Plotly's `fig.write_image`
- Use Pillow for displaying, instead of matplotlib (which is not really made for that)
	- Only matplotlib is supported by sphinx-gallery, the library that renders the examples
augustebaum added a commit to probabl-ai/skore that referenced this issue Oct 29, 2024
This is a quick fix to address #594.

In the end, I took a screenshot manually (by using the "Download plot as png" button of the Plotly widget) and displayed it with matplotlib.

Here are all the alternatives I considered, and what didn't work with them:
- Use SVG instead of PNG
	- For that, I'd need to use Plotly's `fig.write_image`, and the library that Plotly uses for this, Kaleido, is currently broken: plotly/Kaleido#210
- Export plotly figure to a file during the example and read it
	- For that I also need Plotly's `fig.write_image`
- Use Pillow for displaying, instead of matplotlib (which is not really made for that)
	- Only matplotlib is supported by sphinx-gallery, the library that renders the examples
augustebaum added a commit to probabl-ai/skore that referenced this issue Oct 29, 2024
This is a quick fix to address #594.

In the end, I took a screenshot manually (by using the "Download plot as png" button of the Plotly widget) and displayed it with matplotlib.

Here are all the alternatives I considered, and what didn't work with them:
- Use SVG instead of PNG
	- For that, I'd need to use Plotly's `fig.write_image`, and the library that Plotly uses for this, Kaleido, is currently broken: plotly/Kaleido#210
- Export plotly figure to a file during the example and read it
	- For that I also need Plotly's `fig.write_image`
- Use Pillow for displaying, instead of matplotlib (which is not really made for that)
	- Only matplotlib is supported by sphinx-gallery, the library that renders the examples
augustebaum added a commit to probabl-ai/skore that referenced this issue Oct 29, 2024
This is a quick fix to address #594.

In the end, I took a screenshot manually (by using the "Download plot as
png" button of the Plotly widget) and displayed it with matplotlib.

Here are all the alternatives I considered, and what didn't work with
them:
- Use SVG instead of PNG
- For that, I'd need to use Plotly's `fig.write_image`, and the library
that Plotly uses for this, Kaleido, is currently broken:
plotly/Kaleido#210
- Export plotly figure to a file during the example and read it 
	- For that I also need Plotly's `fig.write_image`
- Use Pillow for displaying, instead of matplotlib (which is not really
made for that)
- Only matplotlib is supported by sphinx-gallery, the library that
renders the examples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants