2017-10-20 47 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

相關問題