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

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一次就可了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章