2017-10-20 6 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: module 'pytesseract' n'a pas d'attribut 'image_to_string'

Pourquoi cela arrive ???

Répondre

0

Pouvez-vous essayer ça?

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

Les instructions d'importation doivent être séparées.

+0

Merci. C'était une faute de frappe quand je l'ai collé. – Phemia

+0

Ça ne fonctionnait pas quand ils étaient séparés. – Phemia