Running
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 pillow from https://pypi.python.org/pypi/Pillow/3.0.0 for python 3.5
I read an answer that PIL and pillow can't work together? But if I install from above link with the windows msi installer it'll install PIL and pillow and put it into C:\Users\Rasmus\AppData\Local\Programs\Python\Python35\Lib\site-packages
I've spend an entire day getting 3 lines of code to work. Hope anyone know what may be wrong.
What is your version of pillow,
Pillow >= 2.1.0 no longer supports “import _imaging”. Please use “from PIL.Image import core as _imaging” instead.
this is the official document
https://pillow.readthedocs.io/en/5.1.x/installation.html#warnings
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With