• Register
0 votes

I am new to python programming language and I don;t know how to fix it.


This is my code below :

from PIL import image

import pytesseract

ig = image.open(“Horse.jpg”) 

text = pytesseract.image_to_string(ig, lang=’eng’)


6 2
830 points

1 Answer

0 votes

​​​​​​1. If pytesseract is not installed in your virtual environment or your directories install it in your virtual environment or in your directorie by using the link: https://github.com/UB-Mannheim/tesseract/wiki or by running the command on your command prompt:

            pip install pytesseract

2. Make sure that the tesseract path from default installation time is: ‘C:/Users/USER/AppData/Local/Tesseract-OCR’, or it may change. So carefully check the installation path and note it.

3. Set the tesseract path in the script before calling image_to_string by running commang:

            pytesseract.pytesseract.tesseract_cmd = r‘C:/Users/USER/AppData/Local/Tesseract-OCR/tesseract.exe’



4 1
1,480 points

Related questions

1 vote
1 answer 226 views
Problem: I was trying some code in python using pytesseract but it shows the error message: Pytesseract : TesseractNotFound Error: tesseract is not installed or it's not in your path I wrote the code: from PIL import image import pytesseract ig = image.open( myself.jpg ) ... ig, lang='eng') print(setup) I instaled pytesseract but it is not showing now and how can I fix this problem please help.
asked Apr 24 samhaz 5k points
0 votes
1 answer 4.9K views
Problem : I am getting following error: pytesseract.pytesseract.tesseractnotfounderror: tesseract is not installed or it's not in your path
asked Nov 7, 2019 peterlaw 6.9k points
0 votes
1 answer 34 views
In an XML doument I was trying to build an python tool. It should distribute EXE form But it gives me an error like: cx_freeze python error in main script-ImportError :DLL Load my setup.py file is: import sys from cx_Freeze import setup, Executable base = None if sys. ... 'XPath', 'Attribute Name', 'Current Data'] It builds the Programm with an EXE but when the EXE runs it return the same error.
asked Mar 11 LizzyM 6.1k points
0 votes
3 answers 190 views
I am new in python programming. I am tryin gto iinstall some packages with pip commands. I tried to install a package called unroll by using the command: pip[ install unroll but it gives me some error like : "python setup.py egg_info" failed with error code 1 How can I solve this problem? How can I check my pip version? How can I upgrade my pip version?
asked Mar 9 LizzyM 6.1k points
0 votes
1 answer 11 views
Problem: I am new to programming language. Yesterday I installed python in system. I went to my command prompmt and run the command : python and it shows: Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 01:54:44) [MSC v.1916 64 bit (AMD64)] on ... a different output : python' is not recognized as an internal or external command, operable program or batch file Why am I seeig this , Please help.
asked Mar 22 LizzyM 6.1k points