'Django-error OSError: dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2
When I do manage.py makemigrations An error like this occurs
PS C:\Users\User\PycharmProject\onlineshop-master> python .\manage.py makemigrations
Traceback (most recent call last):
File "C:\Users\User\PycharmProject\onlineshop-master\manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\django\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\django\core\management\base.py", line 316, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\django\core\management\base.py", line 350, in execute
self.check()
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\django\core\management\base.py", line 376, in check
all_issues = self._run_checks(
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\django\core\management\base.py", line 366, in _run_checks
return checks.run_checks(**kwargs)
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\django\core\checks\registry.py", line 71, in run_checks
new_errors = check(app_configs=app_configs)
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\django\core\checks\urls.py", line 40, in check_url_namespaces_unique
all_namespaces = _load_all_namespaces(resolver)
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\django\core\checks\urls.py", line 57, in _load_all_namespaces
url_patterns = getattr(resolver, 'url_patterns', [])
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\django\utils\functional.py", line 37, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\django\urls\resolvers.py", line 533, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\django\utils\functional.py", line 37, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\django\urls\resolvers.py", line 526, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "C:\Users\User\PycharmProject\onlineshop-master\config\urls.py", line 24, in <module>
path('order/', include('order.urls')),
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\django\urls\conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "C:\Users\User\PycharmProject\onlineshop-master\order\urls.py", line 2, in <module>
from .views import *
File "C:\Users\User\PycharmProject\onlineshop-master\order\views.py", line 36, in <module>
import weasyprint
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\weasyprint\__init__.py", line 393, in <module>
from .css import preprocess_stylesheet # noqa
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\weasyprint\css\__init__.py", line 25, in <module>
from . import computed_values
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\weasyprint\css\computed_values.py", line 17, in <module>
from .. import text
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\weasyprint\text.py", line 14, in <module>
import cairocffi as cairo
File "C:\Users\User\PycharmProject\onlineshop\venv\lib\site-packages\cairocffi\__init__.py", line 41, in <module>
cairo = dlopen(ffi, 'cairo', 'cairo-2', 'cairo-gobject-2')
File "C:\Users\User\PycharmProject\onlineshop\venv\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 / cairo-gobject-2
I can't figure out a workaround. How can I solve this? ''' pip install cffi ''' Requirement already satisfied: cffi in c:\users\user\pycharmproject\onlineshop\venv\lib\site-packages (1.15.0) Requirement already satisfied: pycparser in c:\users\user\pycharmproject\onlineshop\venv\lib\site-packages (from cffi) (2.19)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
