-
Notifications
You must be signed in to change notification settings - Fork 41
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
write_image hangs #80
Comments
Hi @adammclaurin, Kaleido shold be compatible with that configuration. Does your system have SELinux running? If so, #37 might be helpful. If not, try the instructions in #36 (comment) to see if we can get a little more logging info. |
Thanks for the feedback @jonmmease . I confirmed that SELinux is not running. Here's a screenshot of the backtrace that gets printed when I stop the Jupyter kernel while write_image() is hung: And here's a screenshot of the output of the debugging command you suggested: Any suggestions? |
Huh, that logging info is all normal. Previously, some folks had an issue with Kaleido hanging while working behind a proxy that hung kaleido's attempt to pull MathJax from a CDN. So you can try two things from (#36 (comment))
Just FYI, kaleido 0.2.1 does bundle MathJax, but plotly.py still overrides the local MathJax path to point to the CDN location. In plotly.py 5, plotly.py will let kaleido use its local offline MathJax, so this won't be an issue any more. |
Thanks @jonmmease, that was exactly the issue. I'm working in a private JupyterHub environment that doesn't have direct access to the internet. Disabling MathJax as you suggested fixed the issue. Do you have an estimate of when plotly.py 5 will be generally available? |
Without committing strongly to any timeline, my hope is that |
It seems that I ran into the same error, however, the proposed solution does not work. I tried the code snipped below and it remains hanging indefinitely. My setup is a Python 3.8.5 venv on Ubuntu (through WSL). Kaleido is version 0.2.1 and Plotly 4.14.3. Downgrading to kaleido 0.1.0 works. import plotly.io as pio
pio.kaleido.scope.mathjax = None
import plotly.graph_objects as go
import json
# Figure
fig = go.Figure(
data=[go.Bar(x=[1, 2, 3], y=[1, 3, 2])],
layout=go.Layout(
title=go.layout.Title(text="A Figure Specified By A Graph Object")
)
)
# Display original figure
# fig.show() # Works
fig.write_image("original_figure.png", format="png", engine="kaleido") # Works In Windows on Python 3.8 the code snippet does work. Also without setting mathjax to None. |
The temporary solution I posted above did not work on another setup. Now I am wondering if the problem is maybe not the same. On the bottom of this post the traceback after I run a KeyboardInterrupt (when it keeps hanging). It seems to be hanging in Note: I installed plotly from jonmmease's branch 'kaleido_v5_updates'. Besides that, kaleido 0.2.1 is now installed. The reference to MathJax.js with this combo of plotly and kaleido is correct: >>> import plotly.io as pio
>>> scope_pio = pio.kaleido.scope
>>> scope_pio.mathjax
'file:///ScratchProject/TestPlotlyUpdateInstallV1/uenv/lib/python3.8/site-packages/kaleido/executable/etc/mathjax/MathJax.js'
|
Hi @chrispijo, Would you mind opening a new issue and copying this info over there? My guess is that this is related to running on WSL, rather than the MathJax issue discussed in this thread. In that new issue, could you please include the output of running the following command after using Ctrl+C to interrupt the write process: import plotly.io as pio
scope = pio.kaleido.scope
print(scope._std_error.getvalue().decode()) Thanks! |
Happy to do so. |
I have the same questions |
Downgrading kaleido also worked for me, although 0.1.0 caused a different error, so I had to use 0.0.3 |
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 |
I'm using kaleido 0.2.1 with plotly 4.14.3 on Python 3.8.1 and RHEL Linux 7.9. I'm trying to run the below example notebook but the write_image() calls never return:
https://plotly.com/python/static-image-export/
I tried multiple image formats and nothing seems to work. Is this a known issue?
Thanks!
The text was updated successfully, but these errors were encountered: