用pil产生验证码出现:ImportError: The _imagingft C module is not installed
2013-07-30 18:42
543 查看
这个是由于PIL没有编译freetype导致的
查看 lib/python2.7/site-packages/PIL/
看看 _imagingft.so 是否存在
# 需要先安装jpeg库
wget http://www.ijg.org/files/jpegsrc.v7.tar.gz tar -zxvf jpegsrc.v7.tar.gz
cd jpeg-7
CC="gcc -arch x86_64"
./configure --enable-shared --enable-static
make
make install
# 然后再安装PIL库
让PIL支持freetype的方法
1、安装freetype开发库
yum install freetype-devel
2、下载源代码http://effbot.org/downloads/Imaging-1.1.7.tar.gz
3、修改setup.py文件
修改
JPEG_ROOT = libinclude("/usr/local")
FREETYPE_ROOT = '/usr/lib64','/usr/include/freetype2/freetype'
4、查看支持项
python setup.py build_ext -i
--- FREETYPE2 support available 注意这一项
5、编译安装
python setup.py install
若上面的设置都失败,则只能拿出下面的杀手锏:
查看 lib/python2.7/site-packages/PIL/
看看 _imagingft.so 是否存在
# 需要先安装jpeg库
wget http://www.ijg.org/files/jpegsrc.v7.tar.gz tar -zxvf jpegsrc.v7.tar.gz
cd jpeg-7
CC="gcc -arch x86_64"
./configure --enable-shared --enable-static
make
make install
# 然后再安装PIL库
让PIL支持freetype的方法
1、安装freetype开发库
yum install freetype-devel
2、下载源代码http://effbot.org/downloads/Imaging-1.1.7.tar.gz
3、修改setup.py文件
修改
JPEG_ROOT = libinclude("/usr/local")
FREETYPE_ROOT = '/usr/lib64','/usr/include/freetype2/freetype'
4、查看支持项
python setup.py build_ext -i
--- FREETYPE2 support available 注意这一项
5、编译安装
python setup.py install
若上面的设置都失败,则只能拿出下面的杀手锏:
sudo apt-get build-dep python-imaging
sudo ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/ sudo ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/ sudo ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/
pip install -U PIL 当现下面的提示时,则说明安装成功了:
-------------------------------------------------------------------- PIL 1.1.7 SETUP SUMMARY -------------------------------------------------------------------- version 1.1.7 platform linux2 2.7.3 (default, Apr 10 2012, 22:21:37) [GCC 4.6.3] -------------------------------------------------------------------- --- TKINTER support available --- JPEG support available --- ZLIB (PNG/ZIP) support available --- FREETYPE2 support available *** LITTLECMS support not available --------------------------------------------------------------------
相关文章推荐
- 用pil产生验证码出现:ImportError: The _imagingft C module is not installed
- 用pil产生验证码出现:ImportError: The _imagingft C module is not installed
- 用pil产生验证码出现:ImportError: The _imagingft C module is not installed
- window下Django第三方APP调用PIL生成验证码出现ImportError: The _imagingft C module is not installed解决
- Python图片处理PIL/pillow/生成验证码/出现KeyError: 和The _imagingft C module is not installed
- Python图片处理PIL/pillow/生成验证码/出现KeyError: 和The _imagingft C module is not installed
- Python图片处理PIL/pillow/生成验证码/出现KeyError: 和The _imagingft C module is not installed
- python PIL ImportError: The _imagingft C module is not installed
- Python 的PIL,可以解决ImportError The _imagingft C module is not installed
- ImportError: The _imagingft C module is not installed
- PIL写入字体出现“ImportError: The _imagingft C module is not installed”的解决方法
- ImportError: The _imagingft C module is not installed
- PIL写入字体出现ImportError:The _imagingft C module is not installed 错误的解决方法
- Pillow-PIL的完全Fok替代库--完美解决报错The _imagingft C module is not installed的解决方案
- 解决Windows下PIL库的"The _imagingft C module is not installed"错误
- PIL “The _imagingft C module is not installed” 错误补救
- 关于captcha使用The _imagingft C module is not installed的错误处理
- centos下安装pillow报ImportError: The _imagingft C module is not installed的解决方案
- 安装PIL时_imagingft C module is not installed错误的解决方法
- ImportError: The _imagingft C module is not installed