Python: The _imagingft C module is not installed错误的解决

Python: The _imagingft C module is not installed错误的解决

By 白熊花田(http://blog.csdn.net/whiterbear) 转载需注明出处。谢谢。

在使用PIL模块给图片加入文本时发现调用字体时出现 The _imagingft C module is not installed 错误。

找到的原因是:官网的PIL版本号编译的时候缺少东西(PIL was compiled without libfreetype)。

解决的方法是:

  • brew install freetype
  • sudo pip uninstall pil
  • sudo pip install pillow

我的是OSX系统,其它情况能够參考stackoverflow.

原文地址:https://www.cnblogs.com/zsychanpin/p/7105569.html