0

I'm trying to install the Python PIL library on mac OS 10.13.

I know about Pillow, but I want my code to work on Google App Engine which only supports PIL.

I tried sudo pip install pil and got:

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. Trying to install a specific version, like pil==1.1.6, got the same result. Writing PIL instead of pil also didn't help.

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:

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?

Uncommon
  • 3,323
  • 2
  • 18
  • 36
  • `pip install Pillow` – user1767754 Dec 11 '17 at 00:09
  • Any use? https://gist.github.com/thomskaf/3236730 – Xantium Dec 11 '17 at 00:17
  • Trying with upper-case? (Seen here: https://blog.artooro.com/2013/01/04/how-to-install-pil-python-imaging-library-on-mac-os-x-10-8/ ) Trying some ancient way as https://gist.github.com/jywsn/c9fc436a76f1186a35b4 or even https://gist.github.com/thomskaf/3236730 ? You may find this one (and what it links) interesting: https://apple.stackexchange.com/questions/233405/how-to-install-pil-in-el-capitan-with-pip – tevemadar Dec 11 '17 at 00:21
  • @Simon and @tevemadar - Those all involve running `python setup.py` on the downloaded package, which runs into the same X11 compiler error I saw before. – Uncommon Dec 12 '17 at 00:06

1 Answers1

1

I solved the X11 compiler error by doing xcode-select --install

Found the answer here: https://stackoverflow.com/a/43716118/310159

Uncommon
  • 3,323
  • 2
  • 18
  • 36