Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PYTesseract Problem
#1
I've installed PYTesseract but cannot use it. I am getting a traceback that makes no sense to me.
Error:
Traceback (most recent call last): File "./vpnpw.py", line 19, in <module> print(image_to_string(Image.open(pngfile))) File "/usr/lib/python2.7/site-packages/pytesseract/pytesseract.py", line 350, in image_to_string }[output_type]() File "/usr/lib/python2.7/site-packages/pytesseract/pytesseract.py", line 349, in <lambda> Output.STRING: lambda: run_and_get_output(*args), File "/usr/lib/python2.7/site-packages/pytesseract/pytesseract.py", line 260, in run_and_get_output run_tesseract(**kwargs) File "/usr/lib/python2.7/site-packages/pytesseract/pytesseract.py", line 232, in run_tesseract raise TesseractNotFoundError() pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your path
Why is is looking for tesseract when the module is named pytesseract? Should I create a symbolic link for 'tesseract' to 'pytesseract' or did I do something else wrong in the install? TIA.
Reply
#2
As explained in the docs:
Quote:Python-tesseract is a wrapper for Google’s Tesseract-OCR Engine.

Also from the examples:

# If you don't have tesseract executable in your PATH, include the following:
pytesseract.pytesseract.tesseract_cmd = r'<full_path_to_your_tesseract_executable>'
# Example tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract'
You need to install Google’s Tesseract-OCR Engine
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
I thought I had but that was it. Thanks.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with CV2 pytesseract detcet numbers korenron 0 1,450 Apr-29-2021, 02:48 PM
Last Post: korenron
  help with pytesseract.image_to_string(savedImage, config='--psm 11')iamge to string korenron 0 2,649 Apr-29-2021, 10:08 AM
Last Post: korenron
  Error when executing pytesseract to get the text from image bvdinesh 3 17,744 Oct-19-2019, 05:01 PM
Last Post: cwco00
  pytesseract - enhance image before OCR kerzol81 0 3,685 Nov-19-2018, 06:21 PM
Last Post: kerzol81
  Getting Tesseract to work for pytesseract bigmit37 0 7,440 May-03-2017, 05:20 PM
Last Post: bigmit37

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020