Mac OSX 安装PIL方法:
tar -zxvf Imaging-1.1.7.tar.gz
chmod -R 755 .cd Imaging-1.1.7
sudo python setup.py install
安装出错,Error信息:
~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/tk.h:78:11: fatal error:
'X11/Xlib.h' file not found
# include <X11/Xlib.h>
~~~~~~~~~~~~
解决对策两步:
1.确认/usr/local/include/X11链接文件目录
$ cd /usr/local/include/
$ ll
total 24
drwxrwxr-x 6 mybook admin 204 Mar 8 12:17 .
drwxr-xr-x 13 root wheel 442 Jan 10 18:52 ..
lrwxr-xr-x 1 mybook admin 162 Mar 8 12:17 X11 -> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11
2.修改环境变量CPPFLAGS/CFLAGS,值就是第一部中的链接文件目录
export CPPFLAGS=-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11