Pil and pillow. ImportError: cannot import name '_imaging'

Performance

from PIL import Image
import pytesseract as pt

text = pt.image_to_string(Image.open("text.png"))

gives me

Traceback (most recent call last):
  File "C:\Users\Rasmus\workspace\PythonMTGO\src\OCR.py", line 1, in <module>
    from PIL import Image
  File "C:\Users\Rasmus\AppData\Local\Programs\Python\Python35\lib\site-packages\PIL\Image.py", line 66, in <module>
    from PIL import _imaging as core
ImportError: cannot import name '_imaging'

I installed the pillow from https://pypi.python.org/pypi/Pillow/3.0.0 for python 3.5

I read the answer that PIL and pillow can't work together? But if I install from the link above with the windows msi installer, it will install the PIL and pillow and put it inC:\Users\Rasmus\AppData\Local\Programs\Python\Python35\Lib\site-packages

I spent the whole day making 3 lines of code work. Hope anyone knows what might be wrong.

+4
source share

All Articles