Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named Image [duplicate]

I have also tried

from PIL import Image 

but it gives me ImportError: No module named PIL.

I have installed PIL successfully using

pip install pil 

and I've also installed xcode command line tools. Nothing seem to work.

Details:

Mac OS X 10.9

Python 2.7.6

python is /Library/Frameworks/Python.framework/Versions/2.7/bin/python

python is /usr/bin/python

python is /usr/local/bin/python

Name: PIL

Version: 1.1.7

Location: /usr/local/lib/python2.7/site-packages/PIL

like image 880
mihalios Avatar asked Jan 30 '14 12:01

mihalios


People also ask

Why PIL is not working in Python?

The Python "ModuleNotFoundError: No module named 'PIL'" occurs when we forget to install the Pillow module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install Pillow command.

What is PIL image in Python?

PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The Image module provides a class with the same name which is used to represent a PIL image.

How do you import an image into Python?

import Image myImage = Image. open("your_image_here"); myImage. show();


1 Answers

The PIL distribution is mispackaged for egg installation.

Install Pillow instead, the friendly PIL fork.

like image 73
Martijn Pieters Avatar answered Sep 26 '22 18:09

Martijn Pieters