Mac OS X 10.9 后无法安装 PIL [英] Can't install PIL after Mac OS X 10.9

查看:45
本文介绍了Mac OS X 10.9 后无法安装 PIL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将我的 Mac OS 更新到 10.9,我发现我的一些(全部?)Python 模块不再存在,尤其是 Image 模块.

I've just updated my Mac OS to 10.9 and I discovered that some (all?) of my Python modules are not here anymore, especially the Image one.

所以我尝试执行sudo pip install pil,但我得到这个错误:

So I try to execute sudo pip install pil, but I get this error:

/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 是最新的,我不知道.有没有可能 PIL 还不兼容 10.9?

My Xcode is up-to-date and I don't have any idea. Is it possible that PIL is not yet 10.9 compatible ?

推荐答案

以下对我有用:

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

更新:

但是下面有更正确的解决方案,由 Will 提供.

But there is more correct solution below, provided by Will.

打开你的终端并执行:xcode-select --install

这篇关于Mac OS X 10.9 后无法安装 PIL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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