2

I'm using Mac and trying to install the Image package for loading images (example: How do I read an image file using Python?).

I'm using anaconda and PyCharm. The python version is 2.7.10.

If I try: pip install Image, it shows:

Requirement already satisfied (use --upgrade to upgrade): Image in ./lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): pillow in ./lib/python2.7/site-packages (from Image)
Requirement already satisfied (use --upgrade to upgrade): django in ./lib/python2.7/site-packages (from Image)

But when I load it, it says "no module named Image".

I tried to install from PyCharm as well, but I cannot find Image from the package search (I can find "image" but seems to be a different one).

Community
  • 1
  • 1
TYZ
  • 8,466
  • 5
  • 29
  • 60

2 Answers2

1

Would this give you what you want:

from PIL import Image
J. Corson
  • 438
  • 3
  • 7
1

You need to install the Python Imaging Library (PIL). Given that you are using conda:

$ conda install pil

Then, from python:

from PIL import Image
Alexander
  • 105,104
  • 32
  • 201
  • 196
  • Thanks! This works! I tried to import PIL and it was working before so I assumed I have PIL, but seems like the one I had was just a skeleton. – TYZ Sep 17 '15 at 19:44
  • perhaps you imported it into a different environment? – Alexander Sep 17 '15 at 20:03