Python 3“未安装_imagingft C模块”

时间:2014-01-20 11:50:56

标签: python django python-3.x pillow

我想在我的网站上使用django-simple-captcha。我在官方网站上浏览了安装指南,但验证码图像未在借用器中加载,并且此错误出现在控制台中:500 (INTERNAL SERVER ERROR)

然后我在termianl中运行了“python3 manage.py test captcha”命令(我正在制作薄荷15)并收到此错误:ImportError: The _imagingft C module is not installed

是什么原因? (This解决方案对我不起作用)

2 个答案:

答案 0 :(得分:2)

原始pil包尚未与python3兼容, 所以改为使用pillow一个叉子

警告PIL和Pillow目前不能在同一环境中共存。如果您想使用枕头,请先移除PIL。

首先卸载并删除旧的PIL目录(如果存在)

sudo pip uninstall pil
sudo rm -rf /usr/local/lib/python3.2/dist-packages/PIL

安装依赖项

sudo apt-get install libfreetype6-dev

现在安装枕头

pip install Pillow

确保你在/usr/local/lib/python[VERSION]/dist-packages/中安装了枕头 如果安装成功,你应该看到2个目录 的枕2.4.0-py3.2.egg-信息 PIL

see here了解更多详情和其他平台

答案 1 :(得分:0)

这解决了我在Mint 17中尝试启动mintinstall的问题。我遇到的错误是一样的:

" ImportError:未安装_imagingft C模块"

卸载pil并重命名其目录并安装Pillow后,可以再次启动mintinstall。

对我来说,使用mintinstall很重要,因为它允许我从安全级别1,2,3内的Mint存储库安装软件包。

相反,apt-get / synaptic / aptitude会安装软件包而不管Mint安全级别,因此从Mint级别安装可能不需要/不安全的软件包4,5

此致