Exception while using tesseract with CentOS Linux

105 views
Skip to first unread message

Swapnil Paithankar

unread,
Jan 2, 2020, 5:01:59 AM1/2/20
to tesseract-ocr
Hi,

I am getting an exception when I am trying to use tesseract with linux(CentOS version 7 (core)) as follows- 

System.DllNotFoundException: Failed to find library "liblept1753.so" for platform x64. 

I am having hard time solving this. Any help would be appreciated.

Thanks

Lakshay Saini

unread,
Jan 2, 2020, 5:18:31 AM1/2/20
to tesseract-ocr
Hi Swapnil,

Most probably, the problem persists in the location of the liblept.so file.

In my system (CentOS 7), I had the same problem because the code was trying to find liblept.so file, but I had liblept.so.5.0.2.

So, to solve it, I changed the following code inside the "leptonica.py"
lept = ffi.dlopen(find_library('lept'))

to:
lept = ffi.dlopen(find_library('/usr/local/lib/liblept.so.5.0.2')) (The actual path of the lib.)

Regards,
Lakshay Saini

Lorenzo Bolzani

unread,
Jan 2, 2020, 5:28:13 AM1/2/20
to tesser...@googlegroups.com
Hi,
leptonica is a little strange about versions. For example leptonica 1.76 means library version 5.

The library I use is liblept.so.5 under /usr/local/lib/, /usr/lib/x86_64-linux-gnu/  (with Mint 19, Ubuntu based)

I suppose you already have this if you correctly installed leptonica. You can check this with:

ldconfig -p | grep lept

So I suppose you just need to replace the "1753" somewhere with a "5" so that it looks for this file (if you are compiling something). Or create a symlink to liblept1753.so (I wouldn't do this unless really necessary).

You can try:

ldd /usr/local/bin/tesseract

(change the path to your tesseract executable if different) to see what libraries the executable is actually looking for. If it wants liblept1753.so you need to find a package with this file or use a symlink.


Lorenzo


--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/12bc4071-9257-48cc-a907-6e367aaf9349%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages