Installing PIL
Mac or Linux installation command: sudo easy_install PIL
If error: Fatal error: ' freetype/fterrors.h ' File not found
Mac depends on the FreeType link change problem, resolved as follows:
Ln-s/usr/local/include/freetype2/usr/local/include/freetype
sudo easy_install-u pil
If a problem occurs: decoder JPEG not available
Uninstall your PIL
Download libjpeg:http://www.ijg.org/files/jpegsrc.v7.tar.gz
Install Libjpeg:
$ tar zxvf jpegsrc.v7.tar.gz $ cd jpeg-7 $./configure--enable-shared--enable-static $ make $ sudo make install< /c2>
Download pil:http://effbot.org/downloads/imaging-1.1.7.tar.gz
Edit setup.py, set:
Jpeg_root = Libinclude ("/usr/local")
Zlib_root = Libinclude ("/usr/local")
Installing PIL
$ python setup.py build $ sudo python setup.py install--optimize=1 $ python Selftest.py-run the selftest to confirm PIL is
Restart Idle
Use examples to refer to:
Instance
For more information about PIL, please refer to the PIL official documentation:
http://effbot.org/imagingbook/
QRCode: Generate two-dimensional code
Installing Qrcode:sudo Easy_install QRCode
Test code (AT command line input): QR "Test" > Test.png
Pil:python Imaging Library (image Processing Standard gallery)