Open tasteitslight opened 1 year ago
Same here. Example:
pip3 install cairosvg
from cairosvg import svg2pdf
svg2pdf(url='./input/test.svg', write_to='./input_tmp/test.png')
Python 3.11.4 - Windows 10
Any idea?
The solution was given in #388 and #329. But a more permeant resolution is possible in the source code to anyone more experienced following the instructions also previously given on this site.
One possible solution (for windows especially): use pycairo
instead of cairocffi
the benefit of this on Windows is that it provides a pyd
cairo binary in the wheel. I don't know the broader implications of this change, but it could provide a "pure pip" installation method on windows which seems valuable to me.
For OSX users: I had the same issue that I managed to solve by setting the following variable in my .zshrc
(should be the same if you are using bash in .bashrc
or .bash_profile
):
export DYLD_LIBRARY_PATH="/opt/homebrew/opt/cairo/lib:$DYLD_LIBRARY_PATH"
My problem (MBP M1) was that the Python shipped with OSX could not resolve packages installed with Homebrew without this. Hopefully it will not disappear on me.
Don't forget the $ source .zshrc
once you've added the variable.
MacOS - This is after
brew install cairo
Traceback shows: