真正的No module named _imagingft的解决方案

来源:互联网 发布:elisa试剂盒数据 编辑:程序博客网 时间:2024/04/28 20:26

wget http://effbot.org/downloads/Imaging-1.1.6.tar.gz

直接build 你会发现依赖库JEPG 或者freetype2没有。

[root@qing186 Imaging-1.1.6]# python setup.py build

running build
running build_py
running build_ext
--------------------------------------------------------------------
PIL 1.1.6 BUILD SUMMARY
--------------------------------------------------------------------
version       1.1.6
platform      linux2 2.6.7 (r267:88850, Aug 10 2011, 11:55:01)
              [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG  support not available
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.


To check the build, run the selftest.py script.

running build_scripts


解决方法是:

1.安装好相关库,yum就可以安装了 --> yum install libjpeg-devel

2.打开并修改imaging的setup.py文件

FREETYPE_ROOT = None
JPEG_ROOT = "/usr/lib64"
TIFF_ROOT = None
ZLIB_ROOT = None
TCL_ROOT = None

再build一次就可了。

原创粉丝点击