• Register
0 votes
163 views

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’)

print(text)

6 2
830 points

Please log in or register to answer this question.

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’

 

 

5 2
1,480 points

Related questions

1 vote
1 answer 298 views
298 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, 2020 samhaz 5k points
0 votes
1 answer 5.8K views
5.8K 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 35 views
35 views
Problem: I am trying to install python package rpy2 with pip install on Ubuntu 16.04: pip install rpy2==2.2.7 but get error message (see full output below): Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-EuOI6K/unroll/
asked Jan 10 Mashhoodch 5.7k points
0 votes
1 answer 38 views
38 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, 2020 LizzyM 6.1k points
0 votes
3 answers 229 views
229 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, 2020 LizzyM 6.1k points
0 votes
1 answer 3 views
3 views
Problem: On the last line, I got this error: builtins.TypeError: must be str, not bytes File "C:\PythonExamples\XmlReportGeneratorExample.py", line 29, in <module> doc.write(outFile) File "c:\Python32\Lib\site-packages\lxml\etree.pyd", line 1853, in lxml.etree._ElementTree.write (src/ ... etree.c:89527) I've installed Python 3.2, and I've installed lxml-2.3.win32-py3.2.exe. On Python 2.7 it works.
asked Jan 9 Mashhoodch 5.7k points
0 votes
1 answer 12 views
12 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, 2020 LizzyM 6.1k points
0 votes
1 answer 114 views
114 views
In one of my jenkins environment build has started failing, while in local machine it seems to be working fine as i have python installed, From the logs i was able to detect that the problem is with internal dependency that is node-gyp v3.5.0 from node-sass v3.8.0 when i ... node -v v5.10.1 gyp ERR! node-gyp -v v3.5.0 gyp ERR! not ok Build failed Any thoughts are much appreciated, Thanks.
asked Oct 27, 2020 psandprop 2.4k points
0 votes
1 answer 28 views