未能加载库:Django saas应用程序djaodjin / djaoapp中的cairo / cairo-2 / cairo-goobject-2 / cairo.so.2

时间:2019-07-27 17:35:21

标签: python django cairo saas pycairo

我正在尝试在Windows计算机上本地运行一个名为djaodjin/djaoapp的开源Django SAAS项目。创建虚拟环境并安装所有要求后,出现以下错误,

Traceback (most recent call last):
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\template\utils.py", line 65, in __getitem__
    return self._engines[alias]
KeyError: 'pdf'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\utils\autoreload.py", line 228, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\core\management\commands\runserver.py", line 124, in inner_run
    self.check(display_num_errors=True)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\core\management\base.py", line 359, in check
    include_deployment_checks=include_deployment_checks,
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\core\management\base.py", line 346, in _run_checks
    return checks.run_checks(**kwargs)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\core\checks\registry.py", line 81, in run_checks
    new_errors = check(app_configs=app_configs)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\core\checks\urls.py", line 16, in check_url_config
    return check_resolver(resolver)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\core\checks\urls.py", line 26, in check_resolver
    return check_method()
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\urls\resolvers.py", line 256, in check
    for pattern in self.url_patterns:
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\utils\functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\urls\resolvers.py", line 407, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\utils\functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\urls\resolvers.py", line 400, in urlconf_module
    return import_module(self.urlconf_name)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\abish\workspace\djaoapp\djaoapp\urls\__init__.py", line 83, in <module>
    url_sites(r'^', include('djaoapp.urls.proxy')),
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\urldecorators\__init__.py", line 15, in include
    return urls.include(arg, namespace=namespace, app_name=app_name)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\conf\urls\__init__.py", line 50, in include
    urlconf_module = import_module(urlconf_module)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\abish\workspace\djaoapp\djaoapp\urls\proxy.py", line 20, in <module>
    url(r'^', include('djaoapp.urls.api')),
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\urldecorators\__init__.py", line 15, in include
    return urls.include(arg, namespace=namespace, app_name=app_name)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\conf\urls\__init__.py", line 50, in include
    urlconf_module = import_module(urlconf_module)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\abish\workspace\djaoapp\djaoapp\urls\api.py", line 8, in <module>
    from ..api.auth import DjaoAppJWTRegister, CredentialsAPIView
  File "C:\Users\abish\workspace\djaoapp\djaoapp\api\auth.py", line 24, in <module>
    from ..mixins import RegisterMixin
  File "C:\Users\abish\workspace\djaoapp\djaoapp\mixins.py", line 13, in <module>
    from pages.locals import get_edition_tools_context_data
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\pages\locals.py", line 52, in <module>
    for engine in loader._engine_list():
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\template\loader.py", line 72, in _engine_list
    return engines.all() if using is None else [engines[using]]
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\template\utils.py", line 89, in all
    return [self[alias] for alias in self]
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\template\utils.py", line 89, in <listcomp>
    return [self[alias] for alias in self]
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\template\utils.py", line 79, in __getitem__
    engine_cls = import_string(backend)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\django\utils\module_loading.py", line 20, in import_string
    module = import_module(module_path)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\extended_templates\backends\pdf.py", line 38, in <module>
    import weasyprint
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\weasyprint\__init__.py", line 441, in <module>
    from .css import preprocess_stylesheet  # noqa isort:skip
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\weasyprint\css\__init__.py", line 30, in <module>
    from . import computed_values, media_queries
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\weasyprint\css\computed_values.py", line 17, in <module>
    from .. import text
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\weasyprint\text.py", line 14, in <module>
    import cairocffi as cairo
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\cairocffi\__init__.py", line 39, in <module>
    cairo = dlopen(ffi, 'cairo', 'cairo-2', 'cairo-gobject-2', 'cairo.so.2')
  File "C:\Users\abish\workspace\djaoapp\djaoapp_env\lib\site-packages\cairocffi\__init__.py", line 36, 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 / cairo.so.2

我尝试使用pip安装cairo,还安装了Microsoft Visual C ++库,但还是没有运气!该如何解决?

0 个答案:

没有答案