ImportError: No module named PIL

Asma Gheisari picture Asma Gheisari · Jan 14, 2012 · Viewed 680.4k times · Source

I use this command in the shell to install PIL:

easy_install PIL

then I run python and type this: import PIL. But I get this error:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
ImportError: No module named PIL

I've never had such problem, what do you think?

Answer

zhiming wang picture zhiming wang · Mar 28, 2014

In shell, run:

pip install Pillow

Attention: PIL is deprecated, and pillow is the successor.