django OSError: no library called "cairo" was found on windows

Mhmoud Amsha picture Mhmoud Amsha · Dec 25, 2019 · Viewed 20.8k times · Source

When I run the Django server, I see this problem !!

OSError: no library called "cairo" was found

no library called "libcairo-2" was found

cannot load library 'libcairo.so': error 0x7e

cannot load library 'libcairo.2.dylib': error 0x

cannot load library 'libcairo-2.dll': error 0x7e

Answer

Green Tree picture Green Tree · Jul 13, 2020

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!