Yes of course, so if I do: fig.show()
, everything works as expected, but when I try fig.write_image('test.png')
, it throws the error below. I tried updating Kaleido but same error. I am running this from a notebook to test with the intention of running the script in a scheduled/always-on task. The exact code works on my own computer.
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-1-975e39b34d61> in <module>
115 fig.add_vline(x=0,line_color="black")
116 fig.update_layout(height=1200, width=1000, title_text=stk+name+'\n'+strat,yaxis_zeroline=True, xaxis_zeroline=True)
--> 117 fig.write_image(local_dir+'RV_IV_images/'+file_extension+'/'+file_extension+'_'+stk+'.png')
118
119
~/.local/lib/python3.8/site-packages/plotly/basedatatypes.py in write_image(self, *args, **kwargs)
3819 import plotly.io as pio
3820
-> 3821 return pio.write_image(self, *args, **kwargs)
3822
3823 # Static helpers
~/.local/lib/python3.8/site-packages/plotly/io/_kaleido.py in write_image(fig, file, format, scale, width, height, validate, engine)
266 # -------------
267 # Do this first so we don't create a file if image conversion fails
--> 268 img_data = to_image(
269 fig,
270 format=format,
~/.local/lib/python3.8/site-packages/plotly/io/_kaleido.py in to_image(fig, format, width, height, scale, validate, engine)
143 # ---------------
144 fig_dict = validate_coerce_fig_to_dict(fig, validate)
--> 145 img_bytes = scope.transform(
146 fig_dict, format=format, width=width, height=height, scale=scale
147 )
~/.local/lib/python3.8/site-packages/kaleido/scopes/plotly.py in transform(self, figure, format, width, height, scale)
151 # Transform in using _perform_transform rather than superclass so we can access the full
152 # response dict, including error codes.
--> 153 response = self._perform_transform(
154 figure, format=format, width=width, height=height, scale=scale
155 )
~/.local/lib/python3.8/site-packages/kaleido/scopes/base.py in _perform_transform(self, data, **kwargs)
291 """
292 # Ensure that kaleido subprocess is running
--> 293 self._ensure_kaleido()
294
295 # Perform export
~/.local/lib/python3.8/site-packages/kaleido/scopes/base.py in _ensure_kaleido(self)
196 self._get_decoded_std_error()
197 )
--> 198 raise ValueError(message)
199 else:
200 startup_response = json.loads(startup_response_string)
ValueError: Failed to start Kaleido subprocess. Error stream:
[0801/084529.959505:ERROR:stack_trace_posix.cc(662)] Failed to read /proc/self/maps
[0801/084530.019262:WARNING:resource_bundle.cc(431)] locale_file_path.empty() for locale
[0801/084530.044932:FATAL:zygote_communication_linux.cc(225)] Check failed: base::PathService::Get(base::FILE_EXE, &chrome_path).
#0 0x55c13b94cd79 <unknown>
#1 0x55c13b8ca633 <unknown>
#2 0x55c13b8da15f <unknown>
#3 0x55c13b8dacde <unknown>
#4 0x55c13a076983 <unknown>
#5 0x55c13a0773c7 <unknown>
#6 0x55c13b63380b <unknown>
#7 0x55c13b631bbc <unknown>
#8 0x55c13b631cfc <unknown>
#9 0x55c13b683182 <unknown>
#10 0x55c13b683025 <unknown>
#11 0x55c1396a1fa8 <unknown>
#12 0x7fc8d7c0a830 <unknown>
#13 0x55c13969b3ea <unknown>
Received signal 6
#0 0x55c13b94cd79 <unknown>
#1 0x55c13b8ca633 <unknown>
#2 0x55c13b94c95b <unknown>
#3 0x7fc8d90c8390 <unknown>
#4 0x7fc8d7c1f428 <unknown>
#5 0x7fc8d7c2102a <unknown>
#6 0x55c13b94b8f5 <unknown>
#7 0x55c13b8da5b2 <unknown>
#8 0x55c13b8dacde <unknown>
#9 0x55c13a076983 <unknown>
#10 0x55c13a0773c7 <unknown>
#11 0x55c13b63380b <unknown>
#12 0x55c13b631bbc <unknown>
#13 0x55c13b631cfc <unknown>
#14 0x55c13b683182 <unknown>
#15 0x55c13b683025 <unknown>
#16 0x55c1396a1fa8 <unknown>
#17 0x7fc8d7c0a830 <unknown>
#18 0x55c13969b3ea <unknown>
r8: 0000000000000000 r9: 0000000000000000 r10: 0000000000000008 r11: 0000000000000206
r12: 00007ffdb471e0e0 r13: 000023bddb344dc0 r14: 000023bddb344dd0 r15: 000023bddb344dd8
di: 00000000001a0395 si: 00000000001a0395 bp: 00007ffdb471d890 bx: 000023bddb344dd8
dx: 0000000000000006 ax: 0000000000000000 cx: 00007fc8d7c1f428 sp: 00007ffdb471d758
ip: 00007fc8d7c1f428 efl: 0000000000000206 cgf: 002b000000000033 erf: 0000000000000000
trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.