> import image
> import pytesseract as pya
>
> pya.tesseract_cmd = r'C:\Users\Euphz\Documents\Artworks\PSD\Speaking
of Dogs\201710'
> print(pya.image_to_string(image.open('doggieville.png')))
Traceback (most recent call last): File "C:\PythonProjects\pytesseract.py", line 2, in import pytesseract as pya File "C:\PythonProjects\pytesseract.py", line 5, in print(pya.image_to_string(image.open('doggieville.png'))) AttributeError: module 'pytesseract' has no attribute 'image_to_string'
为什么会这样???在
你能试试这个吗?在
导入语句需要在单独的行中。在
问题是,您必须将python文件重命名为其他文件pytesseract.py. python文件和tesseract内置函数具有相同的名称。在
相关问题 更多 >
编程相关推荐