Kozea / WeasyPrint

The awesome document factory
https://weasyprint.org
BSD 3-Clause "New" or "Revised" License
7.08k stars 672 forks source link

OSError: no library called "cairo" was found #1240

Closed fehernandez12 closed 3 years ago

fehernandez12 commented 3 years ago

Before you call this a duplicate of #589, #721, #957, #1147, etc., I have tried all tips in the documentation and in those issues, I have not another GFK installed, both my Python and GFK versions are 64bit, the GFK directory is at the top of PATH variable and I have tried with both its regular path and its regular path with a slash "\".

malnajdi commented 3 years ago

@fehernandez12 can you let us know: os: os version: python version: what is the output of WHERE libcairo-2.dll:

Thanks

liZe commented 3 years ago

@fehernandez12 Can you give us more information about your problem?

Aisha-Barahim commented 3 years ago

@fehernandez12 can you let us know: os: os version: python version: what is the output of WHERE libcairo-2.dll:

Thanks

Hi, I am facing the same issue os: windows 10 os version: 64 bit - x64-based-processer Python version: Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] what is the output of WHERE libcairo-2.dll: C:\msys64\mingw64\bin\libcairo-2.dll also I added C:\msys64\mingw64\bin to path and I am still getting this error: OSError: no library called "cairo" was found cannot load library 'C:\msys64\mingw64\bin\libcairo-2.dll': error 0x7f cannot load library 'libcairo.so': error 0x7e cannot load library 'libcairo.2.dylib': error 0x7e cannot load library 'libcairo-2.dll': error 0x7f

Tontyna commented 3 years ago

What is your command to run WeasyPrint? What shell? Or are you within an IDE? Calling WeasyPrint as part of another project?

Aisha-Barahim commented 3 years ago

solved using cmd instead of git bash

liZe commented 3 years ago

solved using cmd instead of git bash

OK, thanks!

Tontyna commented 3 years ago

Yepp, special settings & paths in every IDE/shell other than the default cmd. They all try to be helpful :smirk:

wan-zf commented 3 years ago

if faced such problem when using igraph, try to " pip install pycairo", instead of " pip install cairocffi".

imranrazakhan commented 10 months ago
import os
os.add_dll_directory(r"C:\Program Files\GTK3-Runtime Win64\bin")

You need to call add_dll_directory() before interacting with WeasyPrint.