简体   繁体   English

在Mac OS上安装PIL

[英]Installing PIL on mac OS

I'm trying to install the Python PIL library on mac OS 10.13. 我正在尝试在Mac OS 10.13上安装Python PIL库。

I know about Pillow, but I want my code to work on Google App Engine which only supports PIL. 我了解Pillow,但是我希望我的代码在仅支持PIL的Google App Engine上运行。

I tried sudo pip install pil and got: 我尝试了sudo pip install pil并得到:

Collecting pil
  Could not find a version that satisfies the requirement pil (from versions: )
No matching distribution found for pil

This confuses me because pip search pil does list PIL in the results. 这使我感到困惑,因为pip search pil确实在结果中列出了PIL。 Trying to install a specific version, like pil==1.1.6 , got the same result. 尝试安装特定版本,例如pil==1.1.6 ,得到了相同的结果。 Writing PIL instead of pil also didn't help. PIL代替pil也无济于事。

I also tried giving an explicit URL: sudo pip install http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz but that got a compiler error: 我也尝试给出一个明确的URL: 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

How can I get this installation to work? 如何使该安装正常工作?

I solved the X11 compiler error by doing xcode-select --install 我通过执行xcode-select --install解决了X11编译器错误

Found the answer here: https://stackoverflow.com/a/43716118/310159 在这里找到答案: https : //stackoverflow.com/a/43716118/310159

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM