Install the Python extension library under Mac os PiL

Source: Internet
Author: User

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/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.