Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sadakchap opened this issue Oct 3, 2019 · 7 comments
Closed

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

sadakchap opened this issue Oct 3, 2019 · 7 comments

Comments

@sadakchap
Copy link

Hi,
I completely followed each step mentioned in docs and then hours googling the error but still i am getting this error

import cairocffi as cairo File "C:\Users\---\Dev\ecom\env\lib\site-packages\cairocffi\__init__.py", line 50, in <module> ('libcairo.so', 'libcairo.2.dylib', 'libcairo-2.dll'))
File "C:\Users\---\Dev\ecom\env\lib\site-packages\cairocffi\__init__.py", line 45, in dlopen raise OSError(error_message) # pragma: no cover
OSError: no library called "cairo" was found
cannot load library 'C:\Program Files\GTK3-Runtime Win64\bin\libcairo-2.dll': error 0xc1
cannot load library 'libcairo.so': error 0x7e
cannot load library 'libcairo.2.dylib': error 0x7e
cannot load library 'libcairo-2.dll': error 0xc1

@sadakchap
Copy link
Author

I used the GTK+ 64 Bit Installer and it installed the GTK version 3 here "C:\Program Files\GTK2-Runtime Win64\bin". Added those to path (at the bottom) and later moved it to the top of the path. When running "WHERE libcairo-2.dll" there is no message outputted.
Exactly followed steps but still getting this error

@Tontyna
Copy link
Contributor

Tontyna commented Oct 3, 2019

When running "WHERE libcairo-2.dll" there is no message outputted.

Not even a message that says "Nothing was found"? Bear in mind that the WHERE command doesn't work in PowerShell, only in the ordinary Window command prompt.
You can execute the following command in (any) shell (preferably the one where you wanna run WeasyPrint) and check whether your GTK folder is at the appropriate top position:

python -c "import os; print(*os.environ['PATH'].split(os.pathsep), sep='\n')"

@liZe liZe changed the title OSError: no library called "cairo" was found cannot load library 'C:\Program Files\GTK3-Runtime Win64\bin\libcairo-2.dll': error 0xc1 cannot load library 'libcairo.so': error 0x7e cannot load library 'libcairo.2.dylib': error 0x7e cannot load library 'libcairo-2.dll': error 0xc1 OSError: no library called "cairo" was found Oct 4, 2019
@sadakchap
Copy link
Author

Closing this issue ... after installing both python and GTK of 64 bit and adding a trailing '' slash in path variable resolved this issue....😊

@nehatkkhan786
Copy link

Closing this issue ... after installing both python and GTK of 64 bit and adding a trailing '' slash in path variable resolved this issue....

Hey, bro, I am also facing the same issue but don't know where I am wrong as I did everything as docs but still getting the error 'Cairo was not found '

@sadakchap
Copy link
Author

Closing this issue ... after installing both python and GTK of 64 bit and adding a trailing '' slash in path variable resolved this issue....

Hey, bro, I am also facing the same issue but don't know where I am wrong as I did everything as docs but still getting the error 'Cairo was not found '

check bit version of both python and GTK

@nehatkkhan786
Copy link

nehatkkhan786 commented Mar 17, 2020 via email

@sadakchap
Copy link
Author

sadakchap commented Mar 17, 2020

Both are 64 bit

Sent from my iPhone
On 17-Mar-2020, at 7:00 AM, Prerna Mehra @.***> wrote:  check bit version of both python and GTK — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

And the path variable? Does it have the correct path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants