我试图在mac OS 10.13上安装Python PIL库。
我了解Pillow,但我希望我的代码可以在仅支持PIL的Google App Engine上运行。
我尝试了sudo pip install pil
并得到了:
Collecting pil
Could not find a version that satisfies the requirement pil (from versions: )
No matching distribution found for pil
这让我感到困惑,因为pip search pil
会在结果中列出PIL。尝试安装特定版本(如pil==1.1.6
)会得到相同的结果。写PIL
代替pil
也没有帮助。
我也尝试过提供一个明确的网址:sudo pip install http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz
但是出现了编译错误:
In file included from _imagingtk.c:19:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.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
如何才能使此安装正常工作?