The _imagingft C module is not installed

​ 机器是win7 64,python版本是python 2.7(32) 好像win7 32,xp 32都没出现这个问题

方法一:

http://stackoverflow.com/questions/2088304/installing-pil-python-imaging-library-in-win7-64-bits-python-2-6-4

方法二:

在 PIL官网 给出的链接 http://effbot.org/downloads/#pil 下了个 PIL-1.1.7.win32-py2.7.exe

安装后执行 from PIL import ImageFont font = ImageFont.truetype("DejaVuSans.ttf",25)

报错 The _imagingft C module is not installed

直接import _imagingft,报配置不正确

看来得自己手动编译 PIL了

先到官网上下载这个

http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz

在sourceforge上下载freetype

http://iweb.dl.sourceforge.net/project/freetype/freetype2/2.4.6/freetype-2.4.6.tar.bz2

解压freetype,进freetype-2.4.6\builds\win32\vc2008这个目录,打开freetype.sln

编译,选择lib release

目录freetype-2.4.6\objs\win32\vc2008下会生成一个freetype246MT.lib

更改其名字,叫freetype.lib

把这个lib放到freetype-2.4.6\include目录下

解压Imaging-1.1.7

Imaging-1.1.7,freetype-2.4.6两个在同一目录下

编辑Imaging-1.1.7\setup.py 把 FREETYPE_ROOT = None 这句改为 FREETYPE_ROOT = '../freetype-2.4.6/include'

执行python setup.py build_ext -i

出现:Unable to find vcvarsall.bat 错误

编译出一个_imagingft,将C:\Python27\Lib\site-packages\PIL_imagingft.pyd替换为编译出来的

转载于:https://my.oschina.net/liseor/blog/110133

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值