0

I have such code in the beginning of a file:

from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw

And it throws the error:

python3 main.pyTraceback (most recent call last):
  File "main.py", line 1, in <module>
    from PIL import Image
ImportError: No module named 'PIL'

According to many ad vices I should just replace import PIL with what I actually have. But is doesn't work as you can see.

It's on Ubuntu 14.04 and Python 3.4.0

Incerteza
  • 32,326
  • 47
  • 154
  • 261
  • 2
    http://stackoverflow.com/a/19628673/2915834 sounds like a solution for this. – frlan Apr 19 '14 at 09:11
  • `sudo apt-get install python3-pil`: [http://packages.ubuntu.com/trusty/python3-pil](http://packages.ubuntu.com/trusty/python3-pil). – Eryk Sun Apr 19 '14 at 09:17
  • @frlan - error: `Picking 'pillow' as source package instead of 'python-imaging' E: Unable to find a source package for pillow` – Incerteza Apr 19 '14 at 09:21

1 Answers1

1

According to this you should be able to do import Image instead of import PIL.

Community
  • 1
  • 1
HarryCBurn
  • 755
  • 1
  • 8
  • 17
  • 1
    Debian-based distros use the pillow fork of PIL, which requires [`from PIL import Image`](http://pillow.readthedocs.org/en/latest/porting-pil-to-pillow.html). – Eryk Sun Apr 19 '14 at 17:34