3

Hi, I'm trying to save a plotly image as a static .svg file using kaleido. I have kaleido-0.2.1 installed, but when I run this code on jupyter: fig1.write_image("../figures/supp1A.svg", format="svg", engine="kaleido")
I get this error:

ValueError: 
Image export using the "kaleido" engine requires the kaleido package,
which can be installed using pip:
    $ pip install -U kaleido

Why does this happens even tho kaleido is installed?

top 3 comments
sorted by: hot top controversial new old
[-] ryry1985@lemmy.world 0 points 1 year ago

I've used jupyter, but not extensively. Maybe this can help?

[-] breadcrumb@lemmy.world 0 points 1 year ago

Unfortunatly I'm not using any virtual environments, the packages are installed system-wide and I checked that the python version where the package is installed matched the one used by jupyter. Also, installing from jupyter didn't work either :/

[-] ug01x@lemmy.world 1 points 1 year ago

Here is something where apparently downgrading Kaleido helped. Apparently on Windows if that helps. https://stackoverflow.com/questions/69016568/unable-to-export-plotly-images-to-png-with-kaleido

Otherwise if you are on Linux I do sometimes have to run pip via sudo to get things to show up in the path, although it may not be advisable to do so.

this post was submitted on 12 Jul 2023
3 points (100.0% liked)

pythonhelp

2 readers
1 users here now

A community for posts that include helping Python programmers

Discord:
https://discord.gg/39K88eCxxr

founded 1 year ago
MODERATORS