title: Django - - OSError: dlopen() failed to load a library: cairo / cairo-2 -- Continues to Appear Even After Downloading GTK+ Bundle 3.10.4
body: <p>After installing WeasyPrint, I am getting this error: "Error in Django: OSError: dlopen() failed to load a library: cairo / cairo-2"</p>
  
  <p>Here are all the details:</p>
  
  <pre><code>Unhandled exception in thread started by &lt;function check_errors.&lt;locals&gt;.wrapper at 0x0420DE40&gt;
  Traceback (most recent call last):
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\autoreload.py", line 228, in wrapper
      fn(*args, **kwargs)
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
      self.check(display_num_errors=True)
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py", line 359, in check
      include_deployment_checks=include_deployment_checks,
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py", line 346, in _run_checks
      return checks.run_checks(**kwargs)
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\registry.py", line 81, in run_checks
      new_errors = check(app_configs=app_configs)
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\urls.py", line 16, in check_url_config
      return check_resolver(resolver)
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\urls.py", line 26, in check_resolver
      return check_method()
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py", line 254, in check
      for pattern in self.url_patterns:
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\functional.py", line 35, in __get__
      res = instance.__dict__[self.name] = self.func(instance)
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py", line 405, in url_patterns
      patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\functional.py", line 35, in __get__
      res = instance.__dict__[self.name] = self.func(instance)
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py", line 398, in urlconf_module
      return import_module(self.urlconf_name)
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py", line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "&lt;frozen importlib._bootstrap&gt;", line 994, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 971, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 955, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 665, in _load_unlocked
    File "&lt;frozen importlib._bootstrap_external&gt;", line 678, in exec_module
    File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
    File "C:\Windows\SysWOW64\myshop\myshop\urls.py", line 25, in &lt;module&gt;
      url(r'^orders/', include('orders.urls', namespace='orders')),
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\conf\urls\__init__.py", line 50, in include
      urlconf_module = import_module(urlconf_module)
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py", line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "&lt;frozen importlib._bootstrap&gt;", line 994, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 971, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 955, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 665, in _load_unlocked
    File "&lt;frozen importlib._bootstrap_external&gt;", line 678, in exec_module
    File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
    File "C:\Windows\SysWOW64\myshop\orders\urls.py", line 2, in &lt;module&gt;
      from . import views
    File "C:\Windows\SysWOW64\myshop\orders\views.py", line 7, in &lt;module&gt;
      import weasyprint
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\weasyprint\__init__.py", line 375, in &lt;module&gt;
      from .css import preprocess_stylesheet  # noqa
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\weasyprint\css\__init__.py", line 29, in &lt;module&gt;
      from . import computed_values
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\weasyprint\css\computed_values.py", line 16, in &lt;module&gt;
      from .. import text
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\weasyprint\text.py", line 18, in &lt;module&gt;
      import cairocffi as cairo
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cairocffi\__init__.py", line 41, in &lt;module&gt;
      cairo = dlopen(ffi, 'cairo', 'cairo-2')
    File "C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cairocffi\__init__.py", line 38, in dlopen
      raise OSError("dlopen() failed to load a library: %s" % ' / '.join(names))
  OSError: dlopen() failed to load a library: cairo / cairo-2
  </code></pre>
  
  <p>I have found a solution to a similar problem here on Stackoverflow: <a href="https://stackoverflow.com/questions/38556368/getting-oserror-dlopen-failed-to-load-a-library-cairo-cairo-2-on-windows#">Getting &quot;OSError: dlopen() failed to load a library: cairo / cairo-2&quot; on Windows</a>. As suggested there, I downloaded one of the packages, called GTK+ Bundle 3.10.4, from <a href="http://win32builder.gnome.org/" rel="nofollow noreferrer">http://win32builder.gnome.org/</a>. I followed the instructions mentioned there. But still, the error appears. </p>
  
  <p>I also found another potential solution here: <a href="https://stackoverflow.com/questions/37437041/dlopen-failed-to-load-a-library-cairo-cairo-2">dlopen() failed to load a library: cairo / cairo-2</a></p>
  
  <p>I have installed Choco in my PC and ran the following commands in the Command Prompt.</p>
  
  <pre><code>choco install libcairo2
  </code></pre>
  
  <p>Now, I get these errors:</p>
  
  <pre><code>Chocolatey v0.10.8
  Installing the following packages:
  libcairo2
  By installing you accept licenses for the packages.
  libcairo2 not installed. The package was not found with the source(s) listed.
   If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.
   Version: ""
   Source(s): "https://chocolatey.org/api/v2/"
  </code></pre>
  
  <p><strong>I am completely stuck. Please, help me. I am doing a Django course on building an online shop. I can't proceed unless I fix the issue. So, I am badly in need of help.</strong></p>