Mac OS X 10.9 后无法安装 PIL

编程入门 行业动态 更新时间:2024-10-28 08:27:02
本文介绍了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

本文发布于:2023-06-08 06:35:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/576217.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:OS   Mac   PIL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!