Recentemente ho usato tesseract OCR con python e ho continuato a ricevere un errore quando stavo cercando di importare image_to_string
da tesseract.Errore Python durante l'importazione di image_to_string da tesseract
codice che causa il problema:
# Perform OCR using tesseract-ocr library
from tesseract import image_to_string
image = Image.open('input-NEAREST.tif')
print image_to_string(image)
errore causato dal codice di cui sopra:
Traceback (most recent call last):
file "./captcha.py", line 52, in <module>
from tesseract import image_to_string
ImportError: cannot import name image_to_string
Ho verificato che è installato il modulo tesseract:
[email protected] /home $ pydoc modules | grep 'tesseract'
Hdf5StubImagePlugin _tesseract gzip sipconfig
ORBit cairo mako tesseract
Credo che Ho afferrato tutti i pacchetti richiesti ma sfortunatamente sono solo bloccato a questo punto. Sembra che la funzione non sia nel modulo.
Qualsiasi aiuto molto apprezzato.
try "importazione tesseract.image_to_string", o anche solo "importazione tesseract". – monkut
Penso che tu abbia i binding Python sbagliati ... Cosa hai in 'vars (tesseract)'? – wim