-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Windows error for PlotlyKaleido breaks precompilation #482
Comments
This needs to be fixed. I do not think it is ok PlotlyKaleido to break the compilation of PlotlyJS. In many cases, PlotlyKaleido is not used at all when PlotlyJS is executed. This should be just a warning message. |
I do agree that PlotlyJS should remain usable even if the kaleido process hangs. I also think it should issue a warning at using time if that is the case to prevent surprises when trying to save. |
This is the error message that is just logged with JuliaPlots/PlotlyKaleido.jl#18 Precompilation doesn't fail but |
For me it fails:
|
I was just showing an example putting in an environment PlotlyJS and the dev branch of the PR. The fix on PlotlyKaleido is not merged yet. I guess you were just trying with latest PlotlyJS with the regular published version of PlotlyKaleido? |
Thank you! I will wait! However, I still think it is better to label this as WARNING rather than ERROR. But I might be wrong. |
@montyvesselinov try again and make sure that while adding PlotlyJS version 2.2.4 of PlotlyKaleido (the latest) is installed. Now you should only get a warning during |
Excellent! I will test it soon. Thank you so much!
<https://envitrace.com/>
Velimir “monty” Vesselinov
Co-Founder & CTO - Envitrace
+1 505-473-4150
***@***.***> <https://calendly.com/montyv>
<https://github.com/montyvesselinov>
<https://www.linkedin.com/in/montyvesselinov> <https://montyv.github.io/>
…On Tue, Mar 5, 2024 at 10:26 AM Alberto Mengali ***@***.***> wrote:
@montyvesselinov <https://github.com/montyvesselinov> try again and make
sure that while adding PlotlyJS version 2.2.4 of PlotlyKaleido (the latest)
is installed.
Now you should only get a warning during using or precompilation and get
an error only when trying to call savefig
image.png (view on web)
<https://github.com/JuliaPlots/PlotlyJS.jl/assets/12846528/475a275f-952e-4a80-98a0-8bafb5371461>
—
Reply to this email directly, view it on GitHub
<#482 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABK7C6B3TIK6Z76K5VAFLN3YWX533AVCNFSM6AAAAABEFICHOGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZZGI3TOOBXGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This recent PlotlyKaleido PR JuliaPlots/PlotlyKaleido.jl#17 introduced an error when the kaleido process hangs and does not accept inputs (this should only happen on Windows 10/11 when using Kaleido_jll v0.2).
This was done as on many windows machine (but apparently not all), the execution of the Kaleido_jll library (only for version > 0.1) hangs soon after start.
This is reflected in the diverse amount of related issues in the various kaleido repositories (e.g. #473, JuliaPlots/PlotlyKaleido.jl#13, plotly/Kaleido#134, plotly/Kaleido#110 and others) and is a problem of the kaleido C library that is used by all the various plotly packages to export figures.
This problem is only relevant to some windows machines, and the wide-spread suggested solution is to download to Kaleido (C library) 0.1 to avoid the problem.
The PR in JuliaPlots/PlotlyKaleido.jl#17 caused the call to
PlotlyKaleido.start()
to actually throw an error if the underlying process does not appear to respond (which again should only happen on Windows and for Kaleido v0.2), as the kaleido library is anyhow useless in those situation and at least an error with a suggestion on a possible fix is (in my opinion, the author of the PR) is better than a forever hanging process.Now, in a comment to the aforementioned PR, @montyvesselinov made me notice that this breaks precompilation of PlotlyJS even if he doesn't actually use Kaleido.
I see that a call to
Kaleido.start()
is happening in the__init__()
function of PlotlyJS:PlotlyJS.jl/src/PlotlyJS.jl
Lines 102 to 105 in 75eacf4
This was added in #481 but was actually there from the start.
My question is now the following:
Do we need to pre-start the kaleido library in the init of PlotlyJS to achieve maximum TTFX when calling savefig?
I see three possible ways to solve the precompilation error:
PlotlyKaleido.start
in the__init__
function, so that it's only actually started when someone actually callssavefig
(this should already happen as thesavefig
code is already checking for the running process)PlotlyKaleido.jl
so that the error is not thrown during thePlotlyKaleido.start()
call, but when thesavefig
function is called (similar to 1., but might speed up TTFX ofsavefig
for PlotlyJS only in case the user is not on Windows with 0.2.1 of Kaleido).PlotlyKaleido
to avoid throwing an error (or avoid doing it by default), but this does not actually changes the fact that if the process hangs, Kaleido is not usable and so a different library version must be installed (i.e. 0.1) for it to be usedI expressed the possible solution that came to my mind in my order of preference.
If 2 was to be implemented, for consistency I believe we should avoid throwing errors all-together in
PlotlyKaleido.start
as also the other currently present errors are thrown if the library is not actually usable.@BeastyBlacksmith, do you have any comment on this and suggestions on proposed way-forward?
The text was updated successfully, but these errors were encountered: