Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install tesserocr on windows?

I downloaded executable file of tesseract-OCR and installed it. On the other hand, I also downloaded a zipfile of leptonica from http://www.leptonica.com/download.html. It includes two directory that is lib and include.

Next I tried to do pip install tesserocr in a python virtualenvironment and it returned error

 tesserocr.cpp(460) : fatal error C1083: Cannot open include file: 'leptonica/allheaders.h': No such file or directory

I noticed that allheaders.h is in include directory from the leptonica file I downloaded earlier. How do I solve this? Where should I put the directory include and lib I got from leptonica to make this work?

Is there any other way to install tesseract-ocr and use tesserocr properly on windows computer? Currently I am using Windows 10 to run my python script that use tesseract-ocr to recognize some character on image. I also plan to run the script on windows 7 computer later.

Thank you for your help.

like image 324
Fang Avatar asked Jun 07 '17 06:06

Fang


1 Answers

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>

like image 117
Deepak Sadulla Avatar answered Oct 01 '22 03:10

Deepak Sadulla