Ich habe vor kurzem Tesseract OCR mit Python verwendet und ich bekam immer einen Fehler, wenn ich image_to_string
von Tesseract importieren wollte.Python-Fehler beim Importieren von image_to_string aus Tesseract
-Code das Problem verursacht:
# Perform OCR using tesseract-ocr library
from tesseract import image_to_string
image = Image.open('input-NEAREST.tif')
print image_to_string(image)
Fehler von oben Code verursacht:
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
ich überprüft habe, dass die tesseract-Modul installiert ist:
[email protected] /home $ pydoc modules | grep 'tesseract'
Hdf5StubImagePlugin _tesseract gzip sipconfig
ORBit cairo mako tesseract
Ich glaube, dass Ich habe alle benötigten Pakete geschnappt, aber leider stecke ich an diesem Punkt fest. Es scheint, dass die Funktion nicht im Modul ist.
Jede Hilfe sehr geschätzt.
try "import tesseract.image_to_string" oder auch nur "Import tesseract". – monkut
Ich denke du hast die falschen Python Bindings ... Was hast du in 'vars (tesseract)'? – wim