close

[Solved] django OSError: no library called “cairo” was found on windows

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error django OSError: no library called “cairo” was found on windows in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How django OSError: no library called “cairo” was found on windows Error Occurs?

Today I get the following error django OSError: no library called “cairo” was found on windows in python.

How To Solve django OSError: no library called “cairo” was found on windows Error ?

  1. How To Solve django OSError: no library called “cairo” was found on windows Error ?

    To Solve django OSError: no library called “cairo” was found on windows Error WeasyPrint needs the Pango, cairo and GDK-PixBuf libraries. They are part of GTK+ (formerly known as GIMP Toolkit), and must be installed separately.

  2. django OSError: no library called “cairo” was found on windows

    To Solve django OSError: no library called “cairo” was found on windows Error WeasyPrint needs the Pango, cairo and GDK-PixBuf libraries. They are part of GTK+ (formerly known as GIMP Toolkit), and must be installed separately.

Solution 1

WeasyPrint needs the Pango, cairo and GDK-PixBuf libraries. They are part of GTK+ (formerly known as GIMP Toolkit), and must be installed separately.

After installing GTK+ libraries, do :

python -m weasyprint http://weasyprint.org weasyprint.pdf

Solution 2

Installing GTK+ didn’t work for me. I solved this problem using UniConverter2.0. My environments is

  • Python 3.7
  • Windows 10 x64
  1. Install uniconvertor-2.0rc4-win64_headless.msi,
  2. Find the “dll” sub-directory under the UniConverter installation path.(In my case, C:\Program Files\UniConvertor-2.0rc4\dlls)
  3. Add this “dll” path to the system path.
  4. Close VSCode and reopen the project.
  5. Try to run the server again. Enjoy!

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read