ocrmypdf not able to find tesseract path

357 Views Asked by At

The issue is that ocrmypdf pdf not able to find the tesseract-engine path even though I have added in the environment variables. So I need a quick solution is it possible to externally add path to the ocrmypdf.ocr() function in python.

Even imported the every required library but still it's not working Need a quick solution

1

There are 1 best solutions below

2
On BEST ANSWER

You can define the path in your python script, e.g.:

import pytesseract

# some code to process the image

pytesseract.pytesseract.tesseract_cmd=r'C:\Program Files\Tesseract-OCR\tesseract.exe'

#some other code for ocr

But this should not necessary, if you have in your system environment the pathname, e.g:

C:\Program Files\Tesseract-OCR

and create a variable in your system environmement, too. enter image description here