Open vishalv26 opened 3 years ago
Hello!
This error means that Cairo is not found on your system. The easiest way to install Cairo on Windows is to install GTK for Windows. You can also find links to useful issues in WeasyPrint’s documentation.
Hi. I'm having the same problem. Also using Windows (WIndows 11 in my case). I already installed GTK using the link that you provided. I specifically downloaded this one: https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases/download/2022-01-04/gtk3-runtime-3.24.31-2022-01-04-ts-win64.exe
I also found that you respond the same question to another user called Project Dent. You sugested to use a virtual environment. I also try that and didn't work. Whenever I try to import cairovg in python it throws the same OS Error. The system cannot find Cairo.
My question. How can I use Cairosvg (or Cairo) on Windows?
Thanks!
Just wanted to say, I had this same issue on Windows. I ran the command prompt as Administrator and that fixed it.
No working for me in Windows
same here
When used in Python3.10 on Windows 11, it is not enough to add the GTK3-Runtime Win64 to the path as the dll still does not load correctly. Adding this solves the issue:
gtkbin = r'C:\Program Files\GTK3-Runtime Win64\bin'
add_dll_dir = getattr(os, 'add_dll_directory', None)
if callable(add_dll_dir):
add_dll_dir(gtkbin)
else:
os.environ['PATH'] = os.pathsep.join((gtkbin, os.environ['PATH']))
import cairosvg
I think the above should close this issue.
I think the above should close this issue.
If someone wants to open a PR with code that’s equivalent to what’s done in WeasyPrint, we will probably merge it.
raise OSError(error_message) # pragma: no cover OSError: no library called "cairo" was found no library called "libcairo-2" was found cannot load library 'libcairo.so.2': error 0x7e cannot load library 'libcairo.2.dylib': error 0x7e cannot load library 'libcairo-2.dll': error 0x7e