pythonpippython-imaging-libraryimaging

ImportError: cannot import name _imaging


I installed Pillow, and after I want to do:

from PIL import Image

I get the following error:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/PIL/Image.py", line 61, in <module>
ImportError: cannot import name _imaging

However, if I import these separately, everything is fine, ie:

import _imaging
import Image

Do you know what the problem might be?


Solution

  • I ran into this problem as well. It can happen if you have PIL installed, then install Pillow on top of it.

    Go to /usr/local/lib/python2.7/dist-packages/ and delete anything with "PIL" in the name (including directories). If the Pillow .egg file is there you might as well delete that too. Then re-install Pillow.

    substitute "python2.7" for the version of python you're using.