如何在OS X Mountain Lion上构建PIL?

2024-04-27 19:36:43 发布

您现在位置:Python中文网/ 问答频道 /正文

当我尝试在MacOSX10.8.1 MountainLion上构建PIL时,得到以下结果:

$ 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

Tags: installpybuildincludelibraryerrorcommonsystem