MACOSX10.10 python 安装PIL失败-解决方法

最近想用python搞搞图像,于是安装了PIL  安装过程遇到些问题。


问题如下:

n file included from _imagingtk.c:19:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/tk.h:78:11: fatal error: 'X11/Xlib.h' file not found
#       include <X11/Xlib.h>
                ^
1 error generated.
error: command 'cc' failed with exit status 1

问题原因是xcode不能找到X11头文件,我们对X11进行软连接。

完整安装过程如下:


1   

sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11  /usr/local/include/X11 

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

sudo pip install PIL --allow-external PIL --allow-unverified PIL

参考网址如下: 

http://www.ajucs.com/archives/565.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值