I downloaded and installed tesseract-ocr-setup-3.05.00dev.exe from https://github.com/UB-Mannheim/tesseract/wiki and ticked the Add to Path and Set TESSDATA_PREFIX variable upon installation.
It used to be that my System Path consisted of many things including Python, Node, Npm, etc. Now, it is just a single item of Tesseract (see image)
How can I get back my System Path Variables?
Starting from Tesseract 3.05.00 the Add to Path checkbox was removed, as it caused problems. UB-Mannhaim documentation:
Old versions of the installer had an option to add Tesseract to the
PATH environment variable. That option was disabled by default. If it
was enabled and PATH was very long, it could happen that the new PATH
was empty. We suggest not to use that option and disabled it in our
latest version.
Following the UB-Mannhaim recommendation, instead of adding PATH to system variables you can always consider setting a local variable in your code.
Example from pytesseract documentation:
# If you don't have tesseract executable in your PATH, include the following:
pytesseract.pytesseract.tesseract_cmd = r'<full_path_to_your_tesseract_executable>'
# Example tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract'
Another example for pyocr:
pyocr.tesseract.TESSERACT_CMD = r'<full_path_to_your_tesseract_executable>'
https://superuser.com/a/265575
Restoring System PATH:
Open Regedit
- List item
2.Select HKEY_LOCAL_MACHINE
- File->Load Hive
- Navigate to your C:\Windows\System32\config\RegBack, click the little button to the right of "Open" for "Show Previous Versions": enter image description here**
- Select appropriate revision
- Select SYSTEM.OLD***
- Give it a name (e.g. "Old")
- Navigate to HKEY_LOCAL_MACHINE\"Old"\ControlSet001\Control\Session Manager\Environment
- Open the PATH value and copy it to clipboard, then paste into system environment variables screen.
** I had to use shadowexplorer to export my RegBack first, because it was "currently in use"
*** I just selected SYSTEM