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