How to Install Tesseract for Python on Anaconda

How to solve Tesseract Not Found Error, Anaconda?

You see this error because you don't have tesseract executable in your PATH. So you have to include the following line:

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

You can see an example in the Official documentation of pytesseract.

I wrote the default tesseract executable folder, but if you have changed it, remember to use the <full_path_to_your_tesseract_executable> (as suggested in the previous link).

TesseractNotFoundError Using Anaconda/Jupyter

Quoting from the PyPi page:

Python-tesseract is a wrapper for Google’s Tesseract-OCR Engine.

and (under prequisites):

Install Google Tesseract OCR (additional info how to install the engine on Linux, Mac OSX and Windows)

This means, that pytesseract is not a standalone module. It is a python wrapper for using the Google’s Tesseract-OCR Engine, which you need to install seperately

Trying to install pytesseract on a Python 3.7 conda environment

I have no idea what caused it, but I ended up setting a new environment altogether and reinstalling everything; this time it worked properly.

How to install tesserocr on windows?

Use Anaconda to install TesserOCR in an environment named OCR

  1. Install Anaconda for Windows from here
  2. Open Anaconda Prompt:

    conda create -n OCR python=3.6

    activate OCR

  3. For tesseract 3.5.1 (stable):

    conda install -c simonflueckiger tesserocr

    OR for tesseract 4.0.0 (experimental):

    conda install -c simonflueckiger/label/tesseract-4.0.0-master tesserocr

    OR download the wheel file matching your Windows platform and Python installation from here and install it via:

    pip install <path_to_your_wheel_file>

TesseractNotFoundError: tesseract is not installed or it's not in your path

Step 1: Download and install Tesseract OCR from this link.

Step 2: After installing find the "Tesseract-OCR" folder, double Click on this folder and find the tesseract.exe.

Step 3: After finding the tesseract.exe, copy the file location.

Step 4: Pass this location into your code like this

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

Note: C:\Program Files\Tesseract-OCR\tesseract.exe == your copied location



Related Topics



Leave a reply



Submit