我刚刚将我的 Mac 操作系统更新到 10.9,我发现我的一些(全部?)Python 模块不再存在,尤其是 Image 模块。
所以我尝试执行sudo pip install pil
,但我收到此错误:
/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?
以下对我有用:
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
UPDATE:
但下面有更正确的解决方案,由 Will 提供。
打开你的终端并执行:xcode-select --install
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)