如何在OS X Mountain Lion上构建PIL? [英] How do I build PIL on OS X Mountain Lion?

查看:62
本文介绍了如何在OS X Mountain Lion上构建PIL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在Mac OS X 10.8.1 Mountain Lion上构建PIL时,得到以下结果:

When I try to build PIL on Mac OS X 10.8.1 Mountain Lion, I get the following result:

$ sudo python setup.py install
Password:
running install
running build
running build_py
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -IlibImaging -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.8-intel-2.7/_imaging.o
clang: warning: argument unused during compilation: '-mno-fused-madd'
_imaging.c:75:10: fatal error: 'Python.h' file not found
#include "Python.h"
         ^
1 error generated.
error: command 'clang' failed with exit status 1

推荐答案

PIL不能跟上对新操作系统的支持(通过更改setup.py来设置新的lib目录).但是,您可以使用友好的PIL叉子" Pillow :

PIL does not keep up with support for new operating systems (by making changes to setup.py for new lib dirs, etc). But intstead of PIL, you can use the "friendly PIL fork" Pillow:

如果您遇到相同的错误,请报告该问题:

And if you get the same error, please report the issue:

这篇关于如何在OS X Mountain Lion上构建PIL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆