【问题标题】:Django weasyPrint fontconfig errorDjango weasyPrint fontconfig 错误
【发布时间】:2018-04-06 07:21:54
【问题描述】:

我有一个需要从中获取 pdf 文件的应用程序,因此我选择了 weasyprint,但在使用 PIP 安装后,我导入了 import weasyprint 我在终端 OSError: ctype.util.find_library() did not manage to locate a library called fontconfig 中遇到错误

然后我尝试使用from weasyprint import HTML, CSS from weasyprint.fonts import FontConfiguration 仍然遇到同样的错误。无需编写任何进一步的代码,导入语句就会卡在错误上。截至 10 月,我正在运行最新的 django 和 weasyprint。在此先感谢

【问题讨论】:

    标签: python django weasyprint


    【解决方案1】:

    使用python -m pip install weasyprint, 重新安装 weasyprint,但首先运行

    brew install python3 cairo pango gdk-pixbuf libffi 
    

    在 mac osx 上

    【讨论】:

      猜你喜欢
      • 2022-12-07
      • 1970-01-01
      • 2020-03-14
      • 1970-01-01
      • 1970-01-01
      • 2021-05-26
      • 2013-10-07
      • 2016-12-23
      • 2020-12-16
      相关资源
      最近更新 更多