cannot import name '_imaging' 报错

例子如下:

from PIL import Image
import pytesseract as pt

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

运行结果:

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'

解决方法:

先卸载掉原版本的pillow:

 pip uninstall pillow

在安装4.0.0版本的pillow:

pip install pillow==4.0.0

 

posted @ 2019-01-08 09:04  RamboBai  阅读(9986)  评论(0编辑  收藏  举报