I installed kaleido and orca and used the code:
import plotly.io as pio
pio.write_image(fig, "output. jpg", engine="orca")
Both can not export svg image, the error message is as follows:
ValueError Traceback (most recent call last)
Cell In[23], line 2
1 import plotly.io as pio
----> 2 pio.write_image(fig, "output.jpg", engine="orca")
File c:\Users\David\AppData\Local\Programs\Python\Python312\Lib\site-packages\plotly\io\_kaleido.py:509, in write_image(fig, file, format, scale, width, height, validate, engine)
505 format = infer_format(path, format)
507 # Request image
508 # Do this first so we don't create a file if image conversion fails
--> 509 img_data = to_image(
510 fig,
511 format=format,
512 scale=scale,
513 width=width,
514 height=height,
515 validate=validate,
516 engine=engine,
517 )
519 # Open file
520 if path is None:
521 # We previously failed to make sense of `file` as a pathlib object.
522 # Attempt to write to `file` as an open file descriptor.
File c:\Users\David\AppData\Local\Programs\Python\Python312\Lib\site-packages\plotly\io\_kaleido.py:331, in to_image(fig, format, width, height, scale, validate, engine)
...
>>> plotly.io.orca.config.save()
``