I am trying to use pytesseract in Python but I always end up with the following error:
raise TesseractNotFoundError()
pytesseract.pytesseract.TesseractNo
For Mac:
This should work fine.
Just run these command if you are using linux,
sudo apt update
sudo apt install tesseract-ocr
sudo apt install libtesseract-dev
then run this,
python -m pip install tesseract tesseract-ocr pytesseract
I faced the same problem. I hope you have installed from here and have also done pip install pytesseract
.
If everything is fine you should see that the path C:\Program Files (x86)\Tesseract-OCR where tesseract.exe
is available.
Adding Path variable did not helped me, I actually added new variable with name tesseract
in environment variables with a value of C:\Program Files (x86)\Tesseract-OCR\tesseract.exe
.
Typing tesseract
in the command line should now work as expected by giving you usage informations. You can now use pytesseract
as such (don't forget to restart your python kernel before running this!):
import pytesseract
from PIL import Image
value=Image.open("text_image.png")
text = pytesseract.image_to_string(value, config='')
print("text present in images:",text)
enjoy!
There Are few steps to set the path
1:goto this "https://github.com/UB-Mannheim/tesseract/wiki"
2:download the latest installers
3:install it
4: set the path in system variables such as "C:\Program Files\Tesseract-OCR" or "C:\ProgramFiles (x86)\Tesseract-OCR"
5 : open CMD type "tesseract" and some output except "not regonized type errors"