Solve the Problem of ImageFont import error in CentOS
Centos6 64-bit installation of pil has not been installed, du Niang countless, installed recently. It is hereby recorded. The main problem is that an error is reported when ImageFont is imported.
-
After PIL installation is compiled, a prompt is displayed, indicating that the differential library is installed first.
Copied ..
This is because PIL does not compile freetype. Check lib/python2.7/site-packages/PIL/to see whether _ imagingft. so exists.
# Install the jpeg library wgethttp: // www.ijg.org/files/javassrc.v7.tar.gztar-zxvf?src.v7.tar.gzcd=-7cc= "gcc-archx86_64"./configure -- enable-shared -- enable-staticmakeinstall first
Then install the PIL library.
Let PIL support freetype Methods
1. Install freetype Development Library
yuminstallfreetype-devel
2. Download source code http://effbot.org/downloads/Imaging-1.1.7.tar.gz
3. Modify the setup. py file.
Modify
JPEG_ROOT=libinclude("/usr/local")FREETYPE_ROOT='/usr/lib64','/usr/include/freetype2/freetype'
4. view supported items
pythonsetup.pybuild_ext-i
--- FREETYPE2 support available pay attention to this item
5. Compile and install
Python setup. py install
6. The most important step is to add jpeg to the path of the import system library.
Echo "/usr/local \ lib">/etc/ld. so. conf
Ldconfig
Win764-bit pil
Attachment download:
Pil-1.1.7-win64 bit