Python 的PIL,可以解决ImportError The _imagingft C module is not installed

2021/5/12 20:27:13

本文主要是介绍Python 的PIL,可以解决ImportError The _imagingft C module is not installed,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

删除PIL相关文件 mv PIL /tmp   pip install Pillow 安装Pillow后, 可能还会发生KeyError的错误, 检查项目源码后发现是 Image 模块的save函数中 , 处理图片文件格式时报的错.
不管是"JPEG", 还是"GIF", 都会报错, 解决的办法是:
把项目源码中 import Image , 替换成 from PIL import Image 即可.
按这个原理, 项目中所有用到 Image 模块的地方都应该替换掉。

这篇关于Python 的PIL,可以解决ImportError The _imagingft C module is not installed的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程