Tesseract not working

Asked by Waikit Lau

I installed Tesseract on my MacOS but when I run SikuliX, I get this error..

[error] java.lang.NoClassDefFoundError ( java.lang.NoClassDefFoundError: Could not initialize class net.sourceforge.tess4j.Tesseract1 )

I am on
- MacOS 12.6.8 (Monterey)
- openjdk version "11.0.22" 2024-01-16
- SikuliX 2.0.5

Question information

Language:
English Edit question
Status:
Expired
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
MR HSNNN (lastreaction) said :
#1

First, ensure that Tesseract is correctly installed on your system. You can follow these steps:

Install Tesseract using the Windows installer available at this link (even though you’re on MacOS, this installer works for both Windows and MacOS).

Note the Tesseract path from the installation. The default installation path (as of my last update) is:

C:\Users\USER\AppData\Local\Tesseract-OCR. However, please verify the actual installation path on your system.
Install the Python package pytesseract using pip install pytesseract.

Set the Tesseract path in your script before calling image_to_string

import pytesseract
pytesseract.pytesseract.tesseract_cmd = r'C:\Users\USER\AppData\Local\Tesseract-OCR\tesseract.exe'

Confirm that SikuliX 2.0.5T is the right version for your setup.

Remember to replace C:\Users\USER\AppData\Local\Tesseract-OCR\tesseract.exe with the actual path to your Tesseract installation. If you encounter any further issues, feel free to ask for more assistance at https://zikenlabs.com/

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Open' state without activity for the last 15 days.