82

I try to install PIL but get errors, what should I do?

$ Command
Result
------------
$ pip install PIL

Collecting PIL
  Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL
--------------------------------------------------------------------
$ pip install PIL  --allow-unverified PIL --allow-all-external

DEPRECATION: --allow-all-external has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.
DEPRECATION: --allow-unverified has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.
Collecting PIL
  Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL
Ken Y-N
  • 14,644
  • 21
  • 71
  • 114
Shira
  • 823
  • 1
  • 6
  • 8
  • what system ? On Linux Mint you can use `apt-get` to install `python-pil` or `python-pillow` – furas Dec 26 '16 at 04:23

3 Answers3

167

You could try using Pillow instead, which is a PIL fork:

pip install Pillow

To import use:

from PIL import Image
maviz
  • 2,392
  • 1
  • 11
  • 11
25

The library PIL is in Pillow. Try this:

$ pip install Pillow
Fomalhaut
  • 8,590
  • 8
  • 51
  • 95
1

Not sure if there is a better way than this. But this may work as described in the documentation:

http://www.pythonware.com/products/pil/.

Download the source kit and extract it. Once extracted, do the following as described in the kit.

    $ tar xvfz Imaging-1.1.7.tar.gz
    $ cd Imaging-1.1.7
    $ python setup.py install
apatniv
  • 1,771
  • 10
  • 13
  • In file included from _imagingtk.c:19: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/tk.h:78:11: fatal error: 'X11/Xlib.h' file not found # include ^ 1 error generated. error: command 'cc' failed with exit status 1 – Shira Dec 26 '16 at 04:37
  • See if any of the solutions here solve the problem. http://stackoverflow.com/questions/11465258/xlib-h-not-found-when-building-graphviz-on-mac-os-x-10-8-mountain-lion – apatniv Dec 26 '16 at 04:45