2

I run Python via an Anaconda/Spyder console environment Version - 3.7.2 (default, Jan 2 2019, 17:07:39) [MSC v.1915 64 bit (AMD64)]

I have followed the recommendations from this stackoverflow post: Tesseract Not Found Error

for dealing with the following error:

TesseractNotFoundError: C:\Program Files\Tesseract-OCR esseract.exe is not installed or it's not in your path

Notice that a portion of the path is missing. This is installed at: C:\Program Files\Tesseract-OCR\tesseract.exe

In my pytesseract.py file I changed the path as suggested to: tesseract_cmd = 'C:\Program Files\Tesseract-OCR\tesseract.exe

This didn't solve my issue and resulting in the error message now with part of the path string missing.

TesseractNotFoundError: C:\Program Files\Tesseract-OCR esseract.exe is not installed or it's not in your path

So I played around with this and added a second \ as below:

Python code:

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

Now this works fine and read and successfully converted an entire newspaper page image into string text.

Nothing in the recommendations I followed originally indicated I had to add a second \ to the path, and I don't understand myself why I need to do this.

I would be grateful for any guidance on why this occurred?

chaza68
  • 113
  • 2
  • 8

0 Answers0