I am currently working on optimal character recognition project using python 2.7,open computer vision in windows.To accomplish this task i came to know that it can be done by using tesseract (software).But, it cannot be installed on windows. I searched a lot but i could not get the solution. Can any one tell me is there any way of installing it on windows ?or can it be done without using it?
-
1Have you searched on [GitHub](https://github.com/tesseract-ocr/tesseract)? – FabienP Sep 10 '17 at 12:24
3 Answers
Simple steps for tesseract installation in windows.
Download tesseract exe from https://github.com/UB-Mannheim/tesseract/wiki.
Install this exe in
C:\Program Files (x86)\Tesseract-OCR
Open virtual machine command prompt in windows or anaconda prompt.
Run
pip install pytesseract
To test if tesseract is installed type in python prompt:
import pytesseract
print(pytesseract)

- 347
- 2
- 13

- 211
- 2
- 5
-
-
2@Aashish Raina Please change `pip install tesseract` to `pip install pytesseract`. `tesseract` is some other unrelated package. – user1318499 Dec 05 '21 at 23:35
To accomplish OCR with Python on Windows, you will need Python and OpenCV which you already have, as well as Tesseract and the Pytesseract Python package.
To install Tesseract OCR for Windows:
- Run the installer(find 2021) from UB Mannheim
- Configure your installation (choose installation path and language data to include)
- Add Tesseract OCR to your environment variables
To install and use Pytesseract on Windows:
- Simply run
pip install pytesseract
- You will also need to install Pillow with
pip install Pillow
to use Pytesseract. Import it in your Python document like sofrom PIL import Image
. - You will need to add the following line in your code in order to be able to call pytesseract on your machine:
pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files\\Tesseract-OCR\\tesseract.exe'
I've given a detailed walkthrough of how to install Tesseract OCR for Windows here if you would like further guidance.

- 5,230
- 4
- 34
- 59

- 197
- 1
- 16
-
-
1I thought this as well, but when I tried to execute the pytesseract script without the additional line of code to include the path, it didn't work despite having added the path to the PATH variable as you mentioned. – brad May 28 '23 at 19:16
UB Mannheim provide pre-built binaries for the latest versions of tesseract
.
From tesseract
Github wiki.
Windows
An unofficial installer for windows for Tesseract 3.05-dev and Tesseract 4.00-dev is available from Tesseract at UB Mannheim. This includes the training tools.
...
To access tesseract-OCR from any location you may have to add the directory where the tesseract-OCR binaries are located to the Path variables, probably
C:\Program Files\Tesseract-OCR
.

- 77,184
- 16
- 165
- 176