Using tesserocr.image-to_text (image) to report an error

import tesserocr

print (tesserocr.file_to_text ("image.png"))
Traceback (most recent call last):

File "< ipython-input-16-f4f7f947f1b5 >", line 1, in < module >

print(tesserocr.file_to_text("image.png"))

File "tesserocr.pyx", line 2445, in tesserocr._tesserocr.file_to_text

RuntimeError: Failed to init API, possibly an invalid tessdata path: C:11Anaconda3\

Mar.11,2021

put the tessdata file in the c:11Anaconda3 directory and rerun the code


I have also encountered this problem. Have you solved the
I have played the testdata again or not.


add "TESSDATA_PREFIX" to the system environment variables, and the parent path with the value of testdata (usually the installation path of Tesseract-OCR) can also be solved.


you can refer to this. The problem is solved as well as yours. There are several ways to https://blog.csdn.net/qq_3841.

.
Menu