Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 7169

Tesseract-OCR cannot find input file

$
0
0

i was working locally, i installed tesseract-ocr via sudo apt install tesseract-ocr and use pytesseract to extract data out of the image and it worked perfectly fine.

but when i was working remotely, means ubuntu installed in Windows Server 2019, i cannot install tesseract-ocr via sudo apt install tesseract-ocr due to no network and have to install the windows version of Tesseract-OCR. when i run my code, i got an error

CANNOT READ INPUT FILE: '/tmp/tess_tbljilhy_INPUT.txt'

any idea whats going on here ? even if locally, i dont use the linux tesseract-ocr but instead specify my tesseract to "//mnt//c//Program Files//Tesseract-OCR//tesseract.exe", also same errorthis is the snippet of my code:

pytesseract.pytesseract.tesseract_cmd = "//mnt//c//Program Files//Tesseract-OCR//tesseract.exe"img = Image.open(temp_filename)image_str = pytesseract.image_to_string(img)doc["body"] = image_str

Viewing all articles
Browse latest Browse all 7169

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>