title: Failed to load a library: cairo
body: <p>I keep getting this error when trying to run the following command:</p>
  
  <pre><code>python -m weasyprint http://weasyprint.org weasyprint.pdf
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>  raise OSError("dlopen() failed to load a library: %s" % ' / '.join(names))
  OSError: dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2 / cairo.so.2
  </code></pre>
  
  <p>I installed Weasyprint using <code>pip install weasyprint</code>. To install cairo i used this doc: <a href="https://weasyprint.readthedocs.io/en/latest/install.html" rel="nofollow noreferrer">https://weasyprint.readthedocs.io/en/latest/install.html</a></p>
  
  <p>But, at the end of the guide, when i try to run <code>WHERE libcairo-2.dll</code> i get a <code>not found</code> error.</p>
  
  <p>I have been following the guide step by step but it's not working and i keep getting the same error, i searched for various solutions but none of them fixes the issue. Any advice? Thanks in advance</p>