2017-10-20 48 views
0
> 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'AttributeError的:模块 'pytesseract' 有没有属性 'image_to_string'

为什么会发生???

回答

0

你可以试试吗?

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'))) 

导入语句需要单独行。

+0

谢谢。当我粘贴它时,这是一个错字。 – Phemia

+0

当他们分开时,它不工作。 – Phemia

相关问题