【发布时间】: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 文件安装的完全相同的包。跨度>
-
我也在尝试使用 Weasyprint。
-
@TonyHorrocks 我在 Mac M1 上使用 WeasyPrint 时遇到了同样的问题。你能找到任何解决方案吗?
标签: python-3.7 macos-big-sur django-2.2