This is my problem, I want to use pytesser to get a picture\'s contents. My operating system is Mac OS 10.11, and I have already installed PIL, pytesser, tesseract-ocr engin
You're getting exception because subprocess isn't able to find the binaries (tesser executable).
The installation is a 3 step process:
1.Download/Install system level libs/binaries:
For various OS here's the help. For MacOS you can directly install it using brew.
Install Google Tesseract OCR (additional info how to install the engine on Linux, Mac OSX and Windows). You must be able to invoke the tesseract command as tesseract. If this isn’t the case, for example because tesseract isn’t in your PATH, you will have to change the “tesseract_cmd” variable at the top of tesseract.py. Under Debian/Ubuntu you can use the package tesseract-ocr. For Mac OS users. please install homebrew package tesseract.
Bash script for installing tesseract-ocr on RHEL/CentOS 7
Using yum
- from SO answer - /usr/bin/yum --enablerepo epel-testing install tesseract.x86_64
2.Install Python package
pip install pytesseract
3.Finally, you need to have tesseract binary in you PATH.
Or, you can set it at run-time:
import pytesseract
pytesseract.pytesseract.tesseract_cmd = '<path-to-tesseract-bin>'
The default path 'd be /usr/local/bin/tesseract