Reprinted from Http://www.cnblogs.com/descusr/p/3225874.html
After all the program has been written, the verification code image is not displayed, click on the image address will prompt the following error, and the correct method under Linux
generate verification code with PIL: Importerror:the _imagingft C module is not installed
view lib/python2.7/site-packages/pil/
see if _imagingft.so exists (it's important because it's possible that the system contains 2.6 or 2.7 versions, which must be clarified)
# need to install the JPEG library
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
# then install PIL library
< Span style= "margin:0px; padding:0px; line-height:1.5 "> Let PiL support FreeType method
1, install FreeType Development library
yum Install freetype-devel
2, download source code http:// effbot.org/downloads/imaging-1.1.7.tar.gz
3, modify setup.py file
modify
jpeg_root = Libinclude ("/usr/local ")
freetype_root = '/usr/lib64 ', '/usr/include/freetype2/freetype '
4 , view support items
python setup.py build_ext -I
---FREETYPE2 support available Note This item
5, compile and install
python setup.py Install
If the above settings fail, you can only get the following killer:
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
When the following prompt is present, the installation is successful:
PIL1.1.7SETUP SUMMARY--------------------------------------------------------------------version1.1.7Platform Linux22.7.3(Default, APRTen -, A: +:Panax Notoginseng) [GCC4.6.3]-----------------------------------------------------------------------TKINTER Support Available---JPEG Support Available---ZLIB (png/ZIP) Support available---FREETYPE2 Support Available***littlecms Support not available
Under Windows
No matter how the installation is wrong, you must change Python from the beginning to 32-bit
For the above error, install pillow-2.4.0.win32-py2.7 directly
And then the whole world is quiet.