-
Notifications
You must be signed in to change notification settings - Fork 40
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
Image generation hangs on windows 10 #110
Comments
Having the same issue 😢. |
If it's any help, I am now using wsl2 with ubuntu 20 for this. If it doesn't work on localhost, you can host it on |
If possible, it would be helpful to know if the instructions in this comment produce any additional logging info: #36 (comment) |
I tried doing it in cmd and jupyter notebook but it won't interrupt using ctrl+c/interrupt kernel. Any other ideas? |
Ok, thanks for giving that a try. The next idea is to try to run the kaleido executable CMD, without python. From python, run this to print out the (long) kaleido launch command import plotly.io as pio
print(' '.join(pio.kaleido.scope._build_proc_args())) Then run this from the CMD prompt. If successful, it would print out
along with some benign warnings. But if it hangs here, it would be great to record what is logged. |
Sorry about the late reply, this is what I get. |
+1 for similar issue with similar output as above |
Ok, thanks @ammaar8 and @leeTimothy. That's helpful. It's possible that the key error is
Although the After running that first command, could you try pasting the following content into the console and pressing Enter:
This is an actual image export request, and if successful would print out an SVG string. Again, it would be helpful to know if this prints out any warnings or errors, or if it hangs. Thanks! |
this might be where the behaviour im experiencing might deviate from @ammaar8 although running the output of
provides a very similar trace like ammaar
the command itself never runs to completion and just hangs there. if the behaviour deviates - please let me know if you want me to raise this separately. cheers |
@leeTimothy, the first command is intended to stay running and wait for image export requests. Did you try pasting the JSON snippet I described above and hitting enter? It would be good to know if this hangs, or if any additional info is logged. |
Ah apologies! Please see below.
|
Ok, thanks @leeTimothy. Here are a couple of experiments to try. The long kaleido command has a bunch of chromium flags. e.g. one of them is
If you, or anyone else, is interested in experimenting more with chromium options. Here's a giant list of the available chromium flags: https://peter.sh/experiments/chromium-command-line-switches/. |
Hey Jon, Apols for the late response - believe I may have narrowed it down slightly more. I've got access to 3 different W10 machines, 2 Running OS Build 19043+ both of which Kaleido doesn't currently work. @ammaar8 @guilhermebarrett can you confirm what OS build of W10 you're currently running? |
Hey @leeTimothy, Sorry for the late reply, I'm on 19043.1237 like you are! |
That version info helps a lot, thanks for investigating @leeTimothy and @ammaar8 |
@jonmmease I wasn't able to paste the string in the console. |
Just to add: I have three Windows 10 machines. Two work, these are builds 18363 and 19041. One machine freezes the exact way as described by everyone in this issue, build 19042. |
My machine with Windows build 19043.1237 does not work, but it works fine on a machine running 19042.1266. |
My machine with Windows build 19043.1237 also freezes when writing figures. Running the CMD script yields:
|
I'm seemingly having the same issue on Windows 10 Build 19043.1320. Has anyone figured out a workaround for this? |
I changed back to the other engine (orca?) |
It works with WSL for me |
I have the exact same issue. downgrading |
I am also having this issue on Windows 10 Build: 19043.1348.
|
Same issue here, with Windows 11 Version 10.0.22000 I was able to get it to work by downgrading |
I hope you find this helpful file: Kaleido\scope\base.py
|
I had the same result at @StSchulze ...downgrading to kaleido to 0.1.0post1 worked without any issues. |
I got the same issue in Windows 11. |
I still have this issue on Windows 11 with kaleido 0.2.1. 0.2.1.post1 is for some reason niet available for my platform (windows 11, 64-bit processor, python 3.11) |
Sad for such a long time no one is fixing this |
After about 2 years of encountering this issue (plotly stalls or gets an error when writing plots to PNG on some computers I use, but not all) I found a solution. This does not seem to be linked to particular kaleido/plotly version combinations but essentially boils down to headless (or sort of headless) systems. kaleido (based on chromium, as I understood) can be launched with command line arguments that make it ignore GPU support, physical or xsever screens etc. However, these command line options need to be passed to kaleido from plotly. I got the idea here: https://discuss.streamlit.io/t/unable-to-run-plotly-kaleido-on-streamlit-cloud-to-generate-image-exports-from-graphs/23425/6 You can test this in Jupyer notebook:
Here's what happens behind the scenes:
If you launch the kaleido binary (e.g. from ... /lib/python/site-packages.... /kaleido on a headless system (like WSL, which is formally headless) , you will see a crash:
If you launch kaleido on the same headless system with above-mentioned command line arguments, it runs perfectly fine:
I'm not sure that there is a simple explanation why some version combinations of plotly and kaleido fixed the issue. I tried all of these suggestions (without success) before I encountered above-mentioned fix. And there is a logical explanation to it. |
I outcommented the |
@neuropathbasel Do you confirm it works for WSL but not Windows 11 natively? |
I have no Windows machine where I could try. Its an institutional Windows system with admin rights only within WSL. I have never used Python in Windows before.
…--
Dr. med. Jürgen Hench
Oberarzt, Neuropathologie
Universitätsspital Basel | Institut für Medizinische Genetik und Pathologie
Schönbeinstrasse 40 | CH-4031 Basel
Tel +41 61 328 6891 | Fax +41 61 265 3194
E-Mail: ***@***.***
http://pathologie.unispital-basel.ch
ü
Please consider our environment before printing out this e-mail.
Bitte denken Sie an unsere Umwelt, bevor Sie dieses E-Mail ausdrucken!
________________________________
Von: Antoine Jouanjean ***@***.***>
Gesendet: Dienstag, 21. Mai 2024 11:17:58
An: plotly/Kaleido
Cc: Hench Juergen, Dr.; Mention
Betreff: Re: [plotly/Kaleido] Image generation hangs on windows 10 (#110)
@neuropathbasel Do you confirm it works for WSL but not Windows 11 natively? Just tried on W11, Python 3. 11. 7, kaleido==0. 2. 1, but I got an error message (better than hanging forever though) — Reply to this email directly, view it on
ZjQcmQRYFpfptBannerStart
Diese Nachricht stammt von einem externen Absender
Diese Nachricht kam von ausserhalb Ihrer Organisation.
ZjQcmQRYFpfptBannerEnd
@neuropathbasel<https://urldefense.com/v3/__https://github.com/neuropathbasel__;!!EDSXHx-qqdzzoNk!tv6aMNnX5GLqCQXXaEjCwHY4Hxnvkrfiw7OHGAABfmdG88DFef1mYcimv6diVP7NKFFDdFP-XPsD5NXF_sZXxxOFcAI$> Do you confirm it works for WSL but not Windows 11 natively?
Just tried on W11, Python 3.11.7, kaleido==0.2.1, but I got an error message (better than hanging forever though)
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/plotly/Kaleido/issues/110*issuecomment-2122162630__;Iw!!EDSXHx-qqdzzoNk!tv6aMNnX5GLqCQXXaEjCwHY4Hxnvkrfiw7OHGAABfmdG88DFef1mYcimv6diVP7NKFFDdFP-XPsD5NXF_sZXULKsNho$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AOIQ23LB6MPNM7GTXEHSFOLZDMGMNAVCNFSM5DMFOE62U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMJSGIYTMMRWGMYA__;!!EDSXHx-qqdzzoNk!tv6aMNnX5GLqCQXXaEjCwHY4Hxnvkrfiw7OHGAABfmdG88DFef1mYcimv6diVP7NKFFDdFP-XPsD5NXF_sZXgjyvtdU$>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
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 |
Any updates @gvwilson ? |
Hit this issue, native windows 11. Downgrading to |
hi! I'm just seeing this. There is in fact a release candidate for the next version of kaleido on pypi and plan is to make it an official version this week, just dealing with some annoying platform issues. Will put this issue on watch for further activity. |
@TheSecMaven as a follow-up, "very stupid, do better" is neither polite nor helpful. We are doing the best we can with the resources we have, and while this project has not adopted a formal code of conduct, comments like that are inappropriate. |
I've had trouble with exporting/streaming figures to svg on Windows 10 and 11 as well, with the process just running indefinitely. As suggested here, I've been using Today, I tested kaledio versions 0.4.0.rc3 and 1.0.0.rc0 with python 3.10.11 as well as 3.12.0, in the hopes for a change. Unfortunately, they still hang forever. Maybe the following report helps to narrow it down? PS: Not sure whether to post it here ore in #223 System: Windows 11, VSCode 1.95.3 (Notebook) Test code import os
import plotly.graph_objects as go
os.environ["KALEIDO_DEBUG"] = "1"
fig = go.Figure()
fig.add_annotation(
x=0.5,
y=0.5,
xref="paper",
yref="paper",
text="Hello World",
showarrow=False,
font=dict(size=12, color="#ff0000"),
)
fig.write_image("test_kaleido.svg")
fig.show() Output before hanging forever (python 3.12.0, kaleido 1.0.0.rc0) Tempdir: C:\Users\<REDACTED>\AppData\Local\Temp\tmp1mn_17ho
************Displaying generated HTML*************
<!DOCTYPE html>
<html>
<head>
<style id="head-style"></style>
<title>Kaleido-fier</title>
<script>
window.KaleidoReport = ["start"];
function logError(e) {
window.KaleidoReport.push("error");
window.KaleidoReport.push(e);
if (!navigator.onLine) {
window.KaleidoReport.push("offline");
}
}
</script>
<script>
window.PlotlyConfig = {MathJaxConfig: 'local'}
</script>
<script src="https://cdn.plot.ly/plotly-2.35.2.min.js" charset="utf-8" onerror="logError('plotly')"></script>
<script type="text/javascript" id="MathJax-script" src="file:///c:/Users/<REDACTED>/envs/<REDACTED>/Lib/site-packages/kaleido/vendor/mathjax/MathJax.js?config=TeX-AMS-MML_SVG" onerror="logError('mathjax')"></script>
<script src="file:///c:/Users/<REDACTED>/envs/<REDACTED>/Lib/site-packages/kaleido/vendor/kaleido_scopes.js" onerror="logError('scoper')"></script> </head>
<body style="{margin: 0; padding: 0;}"><img id="kaleido-image"><img></body>
</html>
***********************end************************
************Displaying generated HTML*************
<!DOCTYPE html>
<html>
<head>
<style id="head-style"></style>
<title>Kaleido-fier</title>
<script>
window.KaleidoReport = ["start"];
function logError(e) {
window.KaleidoReport.push("error");
window.KaleidoReport.push(e);
if (!navigator.onLine) {
window.KaleidoReport.push("offline");
}
}
</script>
<script>
window.PlotlyConfig = {MathJaxConfig: 'local'}
</script>
<script src="file:///c:/Users/<REDACTED>/envs/<REDACTED>/Lib/site-packages/plotly/package_data/plotly.min.js" charset="utf-8" onerror="logError('plotly')"></script>
<script type="text/javascript" id="MathJax-script" src="file:///c:/Users/<REDACTED>/envs/<REDACTED>/Lib/site-packages/kaleido/vendor/mathjax/MathJax.js?config=TeX-AMS-MML_SVG" onerror="logError('mathjax')"></script>
<script src="file:///c:/Users/<REDACTED>/envs/<REDACTED>/Lib/site-packages/kaleido/vendor/kaleido_scopes.js" onerror="logError('scoper')"></script> </head>
<body style="{margin: 0; padding: 0;}"><img id="kaleido-image"><img></body>
</html>
***********************end************************
Got running loop, threading
Calling thread start
Calling to_image in thread
c:\Users\<REDACTED>\envs\<REDACTED>\Lib\site-packages\choreographer\browser.py:85: UserWarning:
A value has been passed to debug_browser which is not compatible with python. The default value if deug_browser is True is whatever the value of sys.stderr is. sys.stderr may be many things but debug_browser must be a value Popen accepts for stderr, or True.
STDERR: <ipykernel.iostream.OutStream object at 0x0000021B9FBEB6D0>
TEMP DIR NAME: C:\Users\<REDACTED>\AppData\Local\Temp\tmp9h8jc2d9
DEBUG REPORT:
BROWSER_PATH: C:\Program Files\Google\Chrome\Application\chrome.exe
USER_DATA_DIR: C:\Users\<REDACTED>\AppData\Local\Temp\tmp9h8jc2d9
We are in a selector event loop, use loop_hack
read_jsons (blocking):
Task exception was never retrieved
future: <Task finished name='Task-6' coro=<Browser._open_async() done, defined at c:\Users\<REDACTED>\envs\<REDACTED>\Lib\site-packages\choreographer\browser.py:246> exception=UnsupportedOperation('fileno')>
Traceback (most recent call last):
File "c:\Users\<REDACTED>\envs\<REDACTED>\Lib\site-packages\choreographer\browser.py", line 264, in _open_async
self.subprocess = await open_browser(to_chromium=self.pipe.read_to_chromium,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\asyncio\threads.py", line 25, in to_thread
return await loop.run_in_executor(None, func_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\concurrent\futures\thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\<REDACTED>\envs\<REDACTED>\Lib\site-packages\choreographer\chrome_wrapper.py", line 76, in run
return subprocess.Popen(
^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\subprocess.py", line 992, in __init__
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\subprocess.py", line 1406, in _get_handles
errwrite = msvcrt.get_osfhandle(stderr.fileno())
^^^^^^^^^^^^^^^
File "c:\Users\<REDACTED>\envs\<REDACTED>\Lib\site-packages\ipykernel\iostream.py", line 371, in fileno
raise io.UnsupportedOperation(msg)
io.UnsupportedOperation: fileno |
Hey, I'm trying to convert figures into static images but it refuses to work on windows 10. I am using this script for testing -
It just hangs forever. I tried with both kaleido and orca, same thing. I tried to find out where it was hanging using pycharm and it seems to be this line -
Kaleido/repos/kaleido/py/kaleido/scopes/base.py
Line 192 in 6a46eca
If you require anymore info let me know.
The text was updated successfully, but these errors were encountered: