没有名为_imagingft的模块 [英] No module named _imagingft

查看:117
本文介绍了没有名为_imagingft的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个问题:

No module named _imagingft

我已经安装PIL,但它仍然不起作用。我使用OSX。

I have installed PIL, but it still does not work. I use OSX.

我正在为 Django简单验证码

推荐答案

Cristopher的建议对我来说很好

The suggest of Cristopher works very well for me.

详细信息:
1.卸载现有的Python映像库

Details follow: 1. Uninstall existing Python Imaging Library


  1. 下载并提取源代码版本(从这里
    http ://effbot.org/downloads/Imaging-1.1.6.tar.gz

安装freetype2库(您需要freetype的原因_imagingft
处理用于验证码的TrueType字体)

Install freetype2 library (you need freetype cause _imagingft handles TrueType fonts for captcha)

修改setup.py(在PIL提取的源文件夹中)以匹配
freetype2库(例如在我的VPS与Centos我已经将'FREETYPE_ROOT = None'
更改为'FREETYPE_ROOT =/ usr / local / include')

Modify setup.py (in PIL extracted source folder)to match the freetype2 library (e.g. on my VPS with Centos I've changed line 'FREETYPE_ROOT = None' to 'FREETYPE_ROOT = "/usr/local/include"')

构建PIL(python setup.py build)并验证Fr eetype2支持
确定

Build PIL (python setup.py build) and verify that Freetype2 support is ok

安装PIL(python setup.py build)

Install PIL (python setup.py build)

安装完成后,您可以验证库的存在,打开
python控制台,并为_imagingft
库输入'import instructions'。

After installing you could verify existence of library, opening python console and typing 'import instructions for _imagingft library'.

如果您使用ubuntu,您可以使用以下手册:
http://helloworld.infobart.com/compiling-pil-on-ubuntu-natty

If you use ubuntu you can use following manual: http://helloworld.infobart.com/compiling-pil-on-ubuntu-natty

这篇关于没有名为_imagingft的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆