tesseract: tesseract is not installed or it is not in your path
Hi, I am using tesseract in while loop in my script. But from time to time (once daily) I am getting this error. Tesseract is installed and works, but I get this message once per day. How to solve it?
Traceback:
File file.py, line 169, in <module> results.append(pytesseract.image_to_string(im))
File /usr/local/lib/python2.7/dist-packages/pytesseract/pytesseract.py, line 286, in image_to_string
return run_and_get_output(image, 'txt', lang, config, nice)
File /usr/local/lib/python2.7/dist-packages/pytesseract/pytesseract.py, line 201, in run_and_get_output
raise TesseractNotFoundError()
pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your path
version:
tesseract 3.04.01
leptonica-1.74.1
libgif 5.1.4 : libjpeg 6b (libjpeg-turbo 1.5.1) : libpng 1.6.28 : libtiff 4.0.8 : zlib 1.2.8 : libwebp 0.5.2 : libopenjp2 2.1.2
system:
Raspberry Pi Linux Raspbian
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (2 by maintainers)
I have faced the same issue, the solution is very easy,
pytesseract.pytesseract.tesseract_cmd = r"full path to the exe file" pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe"
text = pytesseract.image_to_string(new_image, config=‘–psm 11’)
worked fine for me.
For Linux Distribution (Ubuntu)
try
sudo apt install tesseract-ocr sudo apt install libtesseract-dev
i could nt find the teeseract.exe in program files in my pc.so what shall i do now?