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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM