• Register
0 votes
224 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 484 views
484 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 17 views
17 views
Problem : I am getting following error: pytesseract.pytesseract.tesseractnotfounderror: tesseract is not installed or it's not in your path
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 6.6K views
6.6K 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 17 views
17 views
Problem: I'm new to Python and have been trying to install some packages with pip. But pip install unroll gives me Command "python setup.py egg_info" failed with error code 1 in C:\Users\MARKAN~1\AppData\Local\Temp\pip-build-wa7uco0k\unroll\ How can I solve this?
asked Feb 18 Mashhoodch 13k points
0 votes
1 answer 67 views
67 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 13k points
0 votes
1 answer 43 views
43 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 271 views
271 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 37 views
37 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 13k points
0 votes
1 answer 16 views
16 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
1 vote
1 answer 2 views
2 views
Problem: How can I solve this runtime error? Module compiled against API version 0xa but this version of numpy is 0x9.
asked Mar 30 PkGuy 13.1k points