【发布时间】:2023-03-13 01:04:01
【问题描述】:
from PIL import Image
from tesseract import image_to_string
print image_to_string(Image.open('C:\Users/Uzel/Desktop/pythonfoto/denklem.png'))
print image_to_string(Image.open('C:\Users/Uzel/Desktop/pythonfoto/denklem.png'), lang='eng')
我在安装 tesseract orc 后使用此代码。
Traceback(最近一次调用最后一次): 文件“C:\Users\Uzel\Documents\Visual Studio 2012\Projects\module3.py”,第 28 行,在 从 tesseract 导入 image_to_string ImportError: 无法导入名称 image_to_string
我有这个错误。我试过 pytesseract 但我无法管理。我们能不能解决这个问题。如何?谢谢。
【问题讨论】:
-
将
C:\Users/Uzel/Desktop/pythonfoto/denklem.png更改为C:/Users/Uzel/Desktop/pythonfoto/denklem.png。 -
不幸的是不能再工作了。我认为 tesseract 没有 image_to_string。 pytesseract 如果我安装它就不能安装它。
-
您能详细说明一下吗?您确实对图像路径进行了更改并且它确实工作了一次?
-
是的,我更改并编译但没有工作。你使用 pytesseract 吗?你能给我建议吗?如何下载?
-
我正在使用
pytesseract。您可能会在下面看到我的答案。
标签: python-2.7 visual-studio-2012 tesseract pytesser