正在运行
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'我从https://pypi.python.org/pypi/Pillow/3.0.0为Python3.5安装了pillow
我读到的答案是PIL和pillow不能一起工作?但如果我安装从上面的链接与windows msi安装程序,它会安装PIL和枕头,并将其放入C:\Users\Rasmus\AppData\Local\Programs\Python\Python35\Lib\site-packages
我花了一整天的时间让3行代码工作。希望任何人都知道可能出了什么问题。
发布于 2018-04-21 20:20:28
你的枕头是什么版本,

枕头>= 2.1.0不再支持“导入_imaging”。请使用“from PIL.Image import core as _imaging”代替。
这是官方文件
https://pillow.readthedocs.io/en/5.1.x/installation.html#warnings
发布于 2021-05-17 18:31:36
卸载并安装pillow,这将解决此问题
https://stackoverflow.com/questions/36792639
复制相似问题