Download Libjpeg and zlib:
Http://www.ijg.org/files/jpegsrc.v6b.tar.gz
Http://www.zlib.net
or download the collection package I uploaded.
http://download.csdn.net/detail/zkdemon/7862399
Install Libjpeg:
[python] view plain copy
$ tar zxvf jpegsrc.v7.tar.gz $ cd jpeg-7 $./configure--enable-shared--enable-static $ make $ sudo make install
The default installation is:/usr/local/lib.
Install Zlib:
[plain] view plain copy
$ tar zxvf zlib-1.2.7.tar.gz $/configure $ make $ sudo make install
The default installation is:/usr/local/lib.
Modify the PiL setup.py:
[python] view plain copy
Jpeg_root = "/usr/local/include" zlib_root = "/usr/local/include"
Compile PiL:
[python] view plain copy
$ python setup.py build_ext-i
Test:
[python] view plain copy
$ python selftest.py If you pass the test
Installation:
[plain] view plain copy
$ python setup.py install installed under the/library/python/2.7/site-packages folder
Issues with "X11/xlib.h" Mac OS X sdk10.8/10.9
Reason: Mountain Lion not shipped with X11, but Xquartz project provides mountain server and client libraries for OS X Lion X11: http://xquartz.macosforge.org. You should use Xquartz version 2.7.2 or later.
Workaround: http://xquartz.macosforge.org Download Installation Xquartz
Then modify the header position. [Plain] view plain copy sudo ln-s/opt/x11/include/x11/applications/xcode.app/contents/develo per/platforms/macosx.platform/developer/sdks/macosx10.9.sdk/usr/include/