【发布时间】:2022-12-07 19:23:06
【问题描述】:
当我 import weasyprint 时,出现以下错误:
Fontconfig error: Cannot load default config file: No such file: (null)
有没有办法抑制这个错误,否则程序运行良好。更好的是,我该如何纠正它?
【问题讨论】:
标签: python-3.x weasyprint fontconfig
当我 import weasyprint 时,出现以下错误:
Fontconfig error: Cannot load default config file: No such file: (null)
有没有办法抑制这个错误,否则程序运行良好。更好的是,我该如何纠正它?
【问题讨论】:
标签: python-3.x weasyprint fontconfig
如果你在基于 Unix 的操作系统,我认为你需要在你的操作系统.通常它设置在/etc/profile 但是,如果您从非登录 shell 执行命令(例如,通过 python 脚本或库),那么您需要通过在您的 shell 中执行以下命令来明确设置它并且可能您的问题将得到解决:
➜ export FONTCONFIG_PATH=/etc/fonts
【讨论】: