plotly/plotly.rs

Kaleido doesn't generate the image output on MacOS

Opened this issue ยท 9 comments

I'm using the example from the README.md to test the write_image function, but it neither generates nor panics. I'm on MacOS 15.0.1 (Sequoia).

plotly = { version = "0.10.0", features = ["kaleido"]}
use plotly::{ImageFormat, Plot, Scatter};

fn main() {
    let mut plot = Plot::new();
    let trace = Scatter::new(vec![0, 1, 2], vec![2, 1, 0]);
    plot.add_trace(trace);

    plot.write_image("out.png", ImageFormat::PNG, 800, 600, 1.0);
}

@alceal thanks for reporting the issue. I was under the false impression that only the CI had issues. This means that indeed there is something wrong on MacOS. I will try to see if I can get to the bottom of it using the GitHub runners (don't own a Mac) .
It might also be a Kaleido issue in itself, not a plotly-rs one, but worth looking into.

Just a heads up, we're working on a rebuild of Kaleido. The new versions are on PyPi as v1.0.0rc0. See: https://github.com/plotly/kaleido for a bit more. I'm not sure how Kaleido is integrated into plotly.rs but if there is a coupling on the PyPi project this may have broken it.

We released a few minors (v0.4.0-v0.4.2) but we yanked them as we worked out naming scheme: This is a complete rebuild so we might end up publishing it under a new name.

The timing of this ticket is about when we published the new versions, but as they're now yanked I wouldn't expect further issues.

Hi Nathan, thank you for this info. I noticed that Greg commented on a few tickets on other projects related to Kaleido that a new version is coming out and I am looking forward to that. There is something broken in Kaleido or our integration with which causes this issue on plotly-rs, just didn't have the time to look into it. Will have to take the leap soon.

We are using an older version though. Need to check if the newer release candidate improves things. FYI , in this crate, Kaleido gets downloaded at build time on the users machine and the package version is hardcoded here https://github.com/plotly/plotly.rs/blob/main/plotly_kaleido/build.rs

Hi @alceal, is the architecture of your Mac by any chance arm?

Hi @alceal, is the architecture of your Mac by any chance arm?

@andrei-ng
Not the person you asked, but I wanted to share that I tried this on my Macbook Air to verify.
It does indeed hang (no panic and nothing generated), just as described in this issue.

MacOS Sonoma 14.1.1 (23B81)
Arm CPU (the M1 Apple silicon)

Hi @alceal, is the architecture of your Mac by any chance arm?

@andrei-ng Not the person you asked, but I wanted to share that I tried this on my Macbook Air to verify. It does indeed hang (no panic and nothing generated), just as described in this issue.

MacOS Sonoma 14.1.1 (23B81) Arm CPU (the M1 Apple silicon)

Thank you @emilbratt!

Been trying to track down the problem. It seems that is an Apple M1 Sillicon issue with Kaleido itslef. I asked a colleague to test it on his MacOS and he had no issues with Apple M3 Max . I am inclined to consider it to be a Kaleido issue as there have been some reports in the past related to that plotly/Kaleido#129

I will investigate further and provide another update once I know more.

alceal commented

Hi @alceal, is the architecture of your Mac by any chance arm?

Yes, it's Apple Silicon M1 Max

Thank you for confirming.