Closed cesgarma closed 4 months ago
Adding data to the issue.
Running $ps just noticed that there are many kaleido processes running in the background.
PID TTY TIME CMD
287 pts/0 00:00:01 bash
537 pts/0 00:00:00 kaleido
538 pts/0 00:00:00 kaleido
573 pts/0 00:00:01 kaleido
Hi @cesgarma, thanks for the report.
The next thing you could try would be to call the kaleido native executable from the command line. There are some instructions for that in https://github.com/plotly/Kaleido/issues/26#issuecomment-664948907. These were written for Windows, but the approach is the same for Linux.
Since you're export is working the first time, I expect everything will work up until the first time you enter {"data":{"layout":{}}}
, so do this part multiple times. It will probably hang the second time, but hopefully chromium will output some error info. Please copy all of the terminal output that you see.
All that said, it looks like folks have had trouble with using Chromium-based projects under WSL 1. See https://github.com/microsoft/WSL/issues/648 and https://github.com/microsoft/WSL/issues/2760. So it might not be possible to get this working reliably. I expect things will work better on WSL 2 since this is based on a true Linux VM instead of a Linux-to-windows translation layer.
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 am using Ubuntu running on Windows 10 using WSL1 (https://ubuntu.com/tutorials/ubuntu-on-windows#1-overview).
The first time I run kaleido write_image function to export a PNG figure it works fine.
The second and subsequent times write_image function hangs. When I interrupt with the keyboard I get the following on the terminal: I have left it run overnight and didn't finish so it definitely hangs.
^CTraceback (most recent call last): File "main.py", line 43, in
barChart.graphBarChart(cfg.emotionalGraphFilename, cfg.outputImagesFolder, xAxisLabels, yAxisValues)
File "/home/soltuin/devsource/doc-to-pdf/doc-to-pdf/barChart.py", line 81, in graphBarChart
fig.write_image(fileName, width=barWidth, height=barHeight, engine="kaleido", validate=False)
File "/home/soltuin/pythonenvironments/neocemod/lib/python3.8/site-packages/plotly/basedatatypes.py", line 3251, in write_image
return pio.write_image(self, *args, **kwargs)
File "/home/soltuin/pythonenvironments/neocemod/lib/python3.8/site-packages/plotly/io/_kaleido.py", line 244, in write_image
img_data = to_image(
File "/home/soltuin/pythonenvironments/neocemod/lib/python3.8/site-packages/plotly/io/_kaleido.py", line 130, in to_image
img_bytes = scope.transform(
File "/home/soltuin/pythonenvironments/neocemod/lib/python3.8/site-packages/kaleido/scopes/plotly.py", line 102, in transform
response = self._perform_transform(
File "/home/soltuin/pythonenvironments/neocemod/lib/python3.8/site-packages/kaleido/scopes/base.py", line 218, in _perform_transform
response = self._proc.stdout.readline()
I looked at the kaleido/scopes/base.py line 218 and it seems to be waiting for a response from kaleido process? (I don't know kaleido internals)
Is there anyway I can debug this issue? add verbose of some sort?