【问题标题】:OSError: no library called "cairo" error even after installing macportsOSError: no library called "cairo" 错误即使在安装 macports 之后
【发布时间】:2020-12-24 08:20:49
【问题描述】:

我在尝试使用 python manage.py runserver 命令启动 Django 服务器时遇到此错误。

OSError: no library called "cairo" was found
no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': dlopen(libcairo.so.2, 2): image not found
cannot load library 'libcairo.2.dylib': dlopen(libcairo.2.dylib, 2): image not found
cannot load library 'libcairo-2.dll': dlopen(libcairo-2.dll, 2): image not found

我正在使用 python 3.7、django==2.2.5 和 Mac BigSur 11.0.1 版。

【问题讨论】:

  • this answer 对您有帮助吗? (pip install cairocffi)
  • 否则,请指定您要执行的操作、确切导致错误的代码以及您尝试修复它的方式。 Django 本身不需要 cairo。
  • 您解决问题了吗?迁移到 Big Sur 后,我面临着完全相同的问题,也使用完全相同版本的所有内容、安装的所有依赖项以及从我在以前的电脑上工作的 requirements.txt 文件安装的完全相同的包。跨度>
  • 我也在尝试使用 Wea​​syprint。
  • @TonyHorrocks 我在 Mac M1 上使用 Wea​​syPrint 时遇到了同样的问题。你能找到任何解决方案吗?

标签: python-3.7 macos-big-sur django-2.2


【解决方案1】:

对于 Mac M1,我在尝试安装 weasyprint 时遇到了这个问题,通过将 weasyprint 的版本降级到 53.3 得到了解决。

【讨论】:

    猜你喜欢
    • 2020-12-04
    • 2018-10-05
    • 1970-01-01
    • 1970-01-01
    • 2020-03-01
    • 2011-08-25
    • 2016-11-28
    • 2021-09-25
    • 1970-01-01
    相关资源
    最近更新 更多