Installing Tesseract OCR package in 32-bit UPupBB - (solved)

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

User avatar
cobaka
Posts: 538
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 57 times

Installing Tesseract OCR package in 32-bit UPupBB - (solved)

Post by cobaka »

Hello Puppians,

After some adventures I downloaded and installed Tesseract OCR on my desktop
The single line above shows the end result of my work.
Everything below is a record of everything I did wrong. - but this can be ignored because I discarded ALL my previous effort and installed the package using the Puppy Package Manager. The moral of this: Always work with the latest version of your Puppy.

I would like to run the OCR package called tesseract.
Found and loaded the package - more detail below.
The package runs from bash/CLI

The general form of a command is: tesseract OCR_image.tif outfile.txt

The manual advises I can learn something by typing tesseract --help.
You see the command and the result:
# tesseract --help
tesseract: error while loading shared libraries: libtesseract.so.4: cannot open shared object file: No such file or directory
#

When I invoke tesseract on an image file the result (I mean the error message) is identical. It can't find the shared object.

My method: Info about downloading and installing Tesseract is sparsely spread around the web.
The info I found applied to other versions of Linux where 'god' (i.e. sudo) had to be invoked to install Tesseract.
In other places a package installer was recommended.
I found tesseract binary (version: tesseract-ocr_4.1.1-2build2_i386.deb) on this page:
Link: http://nz.archive.ubuntu.com/ubuntu/poo ... _i386.deb I saved the file to: /home/spot/downloads/

Installing tesseract: Using ROX file manager I clicked on the binary. I saw: do you want to install tesseract? <oh, yes please!>
A moment later I saw a message from the Puppy Package Manager: The following package has been installed:
(and then the name tesseract-ocr_4.1.1 CATEGORY: Utility.)
Then (still from PPM) Note: this package does not have a menu. <OK>

The final <OK> is just to 'shrink' the message box when it has been read.

Help file: Various pages suggested the command: Tesseract --help would provide the usual help msg posted by bash.
For me, --help resulted in a so.4 error message as below:
# tesseract --help
tesseract: error while loading shared libraries: libtesseract.so.4: cannot open shared object file: No such file or directory

Looking for an explanation about shared object errors I found some comment (for Unix installations) that suggest a path variable has not been set. At the bottom of this page: https://www.pythonanywhere.com/forums/topic/28295/ I see this:
"You probably need to set the LD_LIBRARY_PATH environment variable to point to the directory that contains the library file."

I read similar comments on other pages about the so.4 error message. Speaking generally the file structure of Puppy differs from 'common' Linux. I do not know where (in the Puppy file system) the shared object should be placed.

Can anyone here advise me where to go for info about this problem?
Ditto for any help in solving this problem.
I have a large pile of paper documents. I wish to see if they can be transmogrified to UTF-8 text.

Please help! Thanks to all!

cobaka

Distro is: Distro: BionicPup32 19.03
Hardware is: Dell laptop running P4 + 2GiBytes RAM. Old but reliable.
Mostly I will run a desktop box/I3.

Last edited by cobaka on Mon Mar 15, 2021 5:27 am, edited 2 times in total.

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

User avatar
ThruHammer
Posts: 257
Joined: Sun Jul 12, 2020 1:08 am
Location: Ray Brook, NY
Been thanked: 14 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by ThruHammer »

You're running UPupBB32_v8-24?

Figuring its binary lives in /usr/bin, you could run (all lowercase): ldd /usr/bin/tesseract and see if there any additional missing libraries required to launch.

User avatar
Jafadmin
Posts: 379
Joined: Tue Aug 04, 2020 4:51 pm
Has thanked: 68 times
Been thanked: 85 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by Jafadmin »

Put a symlink to libtesseract.so.4 in /lib

User avatar
cobaka
Posts: 538
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 57 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by cobaka »

@ThruHammer
@Jafadmin <--- thank you. pls see my reply to ThruHammer --<<

First, thank you for your reply.
Next, apologies for omitting detail about my OS. According to Pup-Sys-Info: Distro: BionicPup32 19.03

I'm running (at the moment) a slow laptop. Generally I run uPupBB (32-bit)on a desktop box, I3.
(Yes, I'm running a 32 bit OS on a 64-bit CPU ...)

You ask: where is tesseract installed?

According to bash:

# find /usr/ -iname tess*
/usr/bin/tesseract <-------------<< it's here!
/usr/share/man/man1/tesseract.1.gz
/usr/share/doc/tesseract-ocr
#

The result of ldd can be seen (below) in two forms - short & verbose.
I am not familiar with the command ldd; ditto for dependencies (except in the most general sense of 'not familiar'.

I strongly suspect your detective work is relevant to solving my problem with tesseract.
I will study the topic of dependencies and how to make a symbolic link; after that I will post again. <<-- jafadmin --<<

Thank you and woof!

cobaka

--------------------------------------------------------------------------------

Short result from 'ldd' follows:

Code: Select all

# ldd /usr/bin/tesseract
	linux-gate.so.1 (0xb77a8000)
	libtesseract.so.4 => not found
	liblept.so.5 => not found
	libarchive.so.13 => /usr/lib/libarchive.so.13 (0xb76be000)
	libpthread.so.0 => /lib/libpthread.so.0 (0xb769e000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7518000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb74fa000)
	libc.so.6 => /lib/libc.so.6 (0xb731e000)
	libnettle.so.6 => /usr/lib/libnettle.so.6 (0xb72e2000)
	libacl.so.1 => /lib/libacl.so.1 (0xb72d8000)
	liblzo2.so.2 => /lib/liblzo2.so.2 (0xb72b4000)
	liblzma.so.5 => /lib/liblzma.so.5 (0xb7286000)
	liblz4.so.1 => /usr/lib/liblz4.so.1 (0xb7270000)
	libbz2.so.1.0 => /lib/libbz2.so.1.0 (0xb725f000)
	libz.so.1 => /lib/libz.so.1 (0xb7240000)
	libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb7053000)
	/lib/ld-linux.so.2 (0xb77a9000)
	libm.so.6 => /lib/libm.so.6 (0xb6f51000)
	libattr.so.1 => /lib/libattr.so.1 (0xb6f4b000)
	libdl.so.2 => /lib/libdl.so.2 (0xb6f46000)
	libicuuc.so.60 => /usr/lib/libicuuc.so.60 (0xb6d87000)
	libicudata.so.60 => /usr/lib/libicudata.so.60 (0xb53dd000)

--------------------------------------------------------------------------------------------------------------------------

Here is the verbose result from 'ldd' + CLI :

Code: Select all

# ldd -v  /usr/bin/tesseract 
	linux-gate.so.1 (0xb774f000)
	libtesseract.so.4 => not found
	liblept.so.5 => not found
	libarchive.so.13 => /usr/lib/libarchive.so.13 (0xb7665000)
	libpthread.so.0 => /lib/libpthread.so.0 (0xb7645000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb74bf000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb74a1000)
	libc.so.6 => /lib/libc.so.6 (0xb72c5000)
	libnettle.so.6 => /usr/lib/libnettle.so.6 (0xb7289000)
	libacl.so.1 => /lib/libacl.so.1 (0xb727f000)
	liblzo2.so.2 => /lib/liblzo2.so.2 (0xb725b000)
	liblzma.so.5 => /lib/liblzma.so.5 (0xb722d000)
	liblz4.so.1 => /usr/lib/liblz4.so.1 (0xb7217000)
	libbz2.so.1.0 => /lib/libbz2.so.1.0 (0xb7206000)
	libz.so.1 => /lib/libz.so.1 (0xb71e7000)
	libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb6ffa000)
	/lib/ld-linux.so.2 (0xb7750000)
	libm.so.6 => /lib/libm.so.6 (0xb6ef8000)
	libattr.so.1 => /lib/libattr.so.1 (0xb6ef2000)
	libdl.so.2 => /lib/libdl.so.2 (0xb6eed000)
	libicuuc.so.60 => /usr/lib/libicuuc.so.60 (0xb6d2e000)
	libicudata.so.60 => /usr/lib/libicudata.so.60 (0xb5384000)

	Version information:
	/usr/bin/tesseract:
		libpthread.so.0 (GLIBC_2.0) => /lib/libpthread.so.0
		libgcc_s.so.1 (GCC_3.0) => /lib/libgcc_s.so.1
		libstdc++.so.6 (CXXABI_1.3.8) => /usr/lib/libstdc++.so.6
		libstdc++.so.6 (CXXABI_1.3) => /usr/lib/libstdc++.so.6
		libstdc++.so.6 (CXXABI_1.3.9) => /usr/lib/libstdc++.so.6
		libstdc++.so.6 (GLIBCXX_3.4) => /usr/lib/libstdc++.so.6
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.3.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
	/usr/lib/libarchive.so.13:
		liblzma.so.5 (XZ_5.0) => /lib/liblzma.so.5
		liblzma.so.5 (XZ_5.2) => /lib/liblzma.so.5
		libacl.so.1 (ACL_1.0) => /lib/libacl.so.1
		libnettle.so.6 (NETTLE_6) => /usr/lib/libnettle.so.6
		libxml2.so.2 (LIBXML2_2.5.0) => /usr/lib/libxml2.so.2
		libxml2.so.2 (LIBXML2_2.5.2) => /usr/lib/libxml2.so.2
		libxml2.so.2 (LIBXML2_2.6.5) => /usr/lib/libxml2.so.2
		libxml2.so.2 (LIBXML2_2.4.30) => /usr/lib/libxml2.so.2
		libxml2.so.2 (LIBXML2_2.6.0) => /usr/lib/libxml2.so.2
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.15) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.6) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.3.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.16) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.7) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.3.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1.2) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
	/lib/libpthread.so.0:
		ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
		ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
		libc.so.6 (GLIBC_2.3.2) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
		libc.so.6 (GLIBC_PRIVATE) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
	/usr/lib/libstdc++.so.6:
		libm.so.6 (GLIBC_2.0) => /lib/libm.so.6
		ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
		libgcc_s.so.1 (GCC_4.2.0) => /lib/libgcc_s.so.1
		libgcc_s.so.1 (GLIBC_2.0) => /lib/libgcc_s.so.1
		libgcc_s.so.1 (GCC_3.3) => /lib/libgcc_s.so.1
		libgcc_s.so.1 (GCC_3.0) => /lib/libgcc_s.so.1
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.18) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.16) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.3.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.17) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.3.2) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
	/lib/libgcc_s.so.1:
		libc.so.6 (GLIBC_2.2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
	/lib/libc.so.6:
		ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
		ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
		ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
	/usr/lib/libnettle.so.6:
		libc.so.6 (GLIBC_2.3.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
	/lib/libacl.so.1:
		libattr.so.1 (ATTR_1.0) => /lib/libattr.so.1
		libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.3.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
	/lib/liblzo2.so.2:
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
	/lib/liblzma.so.5:
		libdl.so.2 (GLIBC_2.1) => /lib/libdl.so.2
		libdl.so.2 (GLIBC_2.0) => /lib/libdl.so.2
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.17) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
		libpthread.so.0 (GLIBC_2.1) => /lib/libpthread.so.0
		libpthread.so.0 (GLIBC_2.3.3) => /lib/libpthread.so.0
		libpthread.so.0 (GLIBC_2.3.2) => /lib/libpthread.so.0
		libpthread.so.0 (GLIBC_2.0) => /lib/libpthread.so.0
	/usr/lib/liblz4.so.1:
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
	/lib/libbz2.so.1.0:
		libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.3.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
	/lib/libz.so.1:
		libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.3.4) => /lib/libc.so.6
	/usr/lib/libxml2.so.2:
		libz.so.1 (ZLIB_1.2.3.3) => /lib/libz.so.1
		libz.so.1 (ZLIB_1.2.2.3) => /lib/libz.so.1
		liblzma.so.5 (XZ_5.0) => /lib/liblzma.so.5
		libdl.so.2 (GLIBC_2.1) => /lib/libdl.so.2
		libdl.so.2 (GLIBC_2.0) => /lib/libdl.so.2
		libm.so.6 (GLIBC_2.0) => /lib/libm.so.6
		libc.so.6 (GLIBC_2.15) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.7) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.3.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.3.2) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
	/lib/libm.so.6:
		ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
		libc.so.6 (GLIBC_PRIVATE) => /lib/libc.so.6
	/lib/libattr.so.1:
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.2.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
	/lib/libdl.so.2:
		ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_PRIVATE) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
	/usr/lib/libicuuc.so.60:
		libgcc_s.so.1 (GCC_3.0) => /lib/libgcc_s.so.1
		libstdc++.so.6 (CXXABI_1.3.8) => /usr/lib/libstdc++.so.6
		libstdc++.so.6 (GLIBCXX_3.4) => /usr/lib/libstdc++.so.6
		libstdc++.so.6 (CXXABI_1.3) => /usr/lib/libstdc++.so.6
		libdl.so.2 (GLIBC_2.0) => /lib/libdl.so.2
		libdl.so.2 (GLIBC_2.1) => /lib/libdl.so.2
		libm.so.6 (GLIBC_2.0) => /lib/libm.so.6
		libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.7) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.3.4) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
		libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
		libpthread.so.0 (GLIBC_2.0) => /lib/libpthread.so.0
		libpthread.so.0 (GLIBC_2.3.2) => /lib/libpthread.so.0
# 

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

User avatar
ThruHammer
Posts: 257
Joined: Sun Jul 12, 2020 1:08 am
Location: Ray Brook, NY
Been thanked: 14 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by ThruHammer »

Cobaka, you're almost there.

Front and center, install this or grab it via PPM.

As for what Jafadmin was referring to, you need to create a symlink so Tesseract can find libtesseract.so.4.

So long as libtesseract.so.4.0.0 is in your file system, I'm pretty sure he meant for you to run something along the lines that follow...

Code: Select all

ln -s /usr/lib/i386-linux-gnu/libtesseract.so.4.0.0 /lib/libtesseract.so.4

Let us know whether this allows Tesseract to now launch.

User avatar
cobaka
Posts: 538
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 57 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by cobaka »

@ThruHammer

Front and center, install this or grab it via PPM.

Found something on that site (fr. NZ mirror): liblept5_1.75.3-3_i386.deb
I will take a few minutes to understand what I have and how this file is used before I left-click it (using ROX).
At this stage I just down-loaded the file. I did not use PPM - the packet manager.
I'm not even sure if PPM lists this file - I looked a couple of days ago (but only for files beginning with tesseract*

I'm on the way, but proceeding cautiously lest I wreck a good ship on the rocks.

cobaka

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

User avatar
ThruHammer
Posts: 257
Joined: Sun Jul 12, 2020 1:08 am
Location: Ray Brook, NY
Been thanked: 14 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by ThruHammer »

Trust the force Cobaka, "YOUR FORCE!"

Inner growth is about stepping outside your comfort zone and addressing the immediacy of the moment.

User avatar
cobaka
Posts: 538
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 57 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by cobaka »

@ThruHammer

Front and center, install this or grab it via PPM.

Found & downloaded this file: liblept5_1.75.3-3_i386.deb

This file is now sitting in my 'downloads' folder. If I left--click on it and it's not what I need, what is the penalty to me?
I assume (from your instruction) the file contains the so.4 and so.5 files. According to ldd, these are the only files I need.

All the best & woof!

cobaka

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

User avatar
cobaka
Posts: 538
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 57 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by cobaka »

(additional comment)

I ran ldd (as suggested). The result:
libtesseract.so.4 => not found
liblept.so.5 => not found

everything else seems to be in place. (According to ldd).
I haven't made the symbolic link yet.

(more info.)
look at what 'find' reveals:
# find / -iname liblept.so.5
/initrd/mnt/dev_save/PUP_SYS/upupbbsave/home/spot/Downloads/OCR-Tesseract/liblept.so.5
/mnt/sda2/PUP_SYS/upupbbsave/home/spot/Downloads/OCR-Tesseract/liblept.so.5
/home/spot/Downloads/OCR-Tesseract/liblept.so.5
# find / -iname libtesseract.so.4
#
liblept.so.5 is on the drive.
so.4 is not on the drive

In other words I must find/install libtesseract.so.4 before any symbolic link will work.

Comment, please

Cobaka

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

TerryH
Posts: 591
Joined: Mon Jun 15, 2020 2:08 am
Has thanked: 130 times
Been thanked: 137 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by TerryH »

As jafadmin and thruhammer have advised you are missing a lib which needs to e created as a symbolic link. The lib name libtesseract.so.4 is required but not found. It needs to be created linking to a lib which is included in the tesseract package.

Follow thruhammer's command he has posted above to create that symlink. You may get other similar errors for missing libs, which may have a similar fix required. Hopefully it will run after the link is created.

New Laptop - ASUS ZenBook Ryzen 7 5800H Vega 7 iGPU / 16 GB RAM

User avatar
cobaka
Posts: 538
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 57 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by cobaka »

@TerryH

Thank you for your reply. Yes, I understand the situation is as you (and Thruhammer) state.
My posting at 2:12 is poorly written. I have a file and it is probably (but not certainly) the file I need.
It is in my 'downloads' folder. If I click on it it will install 'something' - probably what I need (but not certainly).

Let us assume the file 'almost' but not exactly matches tesseract 4.1.1. Then what? How much trouble will I have to recover my situation. If you say 'no problem' I will click. The solution (or a problem) is only one left-mouse button click away.

I'm tempted, but I wish to avoid a disaster of my own making ....

To click, or not to click, that is the question.
Whether it be better to be impetuous and suffer the slings of inappropriately installed libraries
or to be constrained until one is certain that sweet sleep will follow the pressing of a button ....
I am cobaka - not Hamlet and I know not the answer ....

Woof, sweet puppian, my ears listeneth ....

cobaka

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

User avatar
cobaka
Posts: 538
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 57 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by cobaka »

Progress report. The previously missing library item (dependency) has been found.
I believe the symbolic link has not been successfully made.

(Following steps recommended by ThruHammer)

I located & downloaded liblept5_1.75.3-3_i386.deb from:
http://nz.archive.ubuntu.com/ubuntu/poo ... 3_i386.deb

After a lot of thought I installed liblept5_1.75.3-3_i386.deb (ie using ROX I left-clicked on the file)
The normal installation messages followed.

Restating the goal: I must get libtesseract.so.4 on my disk (or storage).
Did it happen? Here is the result, after installing the 'deb' package above:

# find / -iname "libtesseract.so.4"
/lib/libtesseract.so.4 <--- it's there!! --------------------<<
/initrd/mnt/dev_save/PUP_SYS/upupbbsave/lib/libtesseract.so.4
/mnt/sda2/PUP_SYS/upupbbsave/lib/libtesseract.so.4
#

But tesseract can't find the dependency ....
That means (I think) I have failed to correctly make a symbolic link to the library.
This process is new to me - I don't understand the theory of symlinks.

Proof (via bash) that the link does not exist:
# ldd /usr/bin/tesseract
linux-gate.so.1 (0xb777e000)
libtesseract.so.4 => not found <--- look -----<<
liblept.so.5 => /usr/lib/liblept.so.5 (0xb7491000)
(plus many more, but #2 is the 'not found' of interest.

I'm off to learn about symbolic links etc.
I'm getting there. Thanks to all reading this

cobaka
2021-03-12

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

User avatar
ThruHammer
Posts: 257
Joined: Sun Jul 12, 2020 1:08 am
Location: Ray Brook, NY
Been thanked: 14 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by ThruHammer »

It may be expecting to find it in /usr/lib, so run this symlink. More than one is fine.

Code: Select all

ln -s /usr/lib/i386-linux-gnu/libtesseract.so.4.0.0 /usr/lib/libtesseract.so.4

libtesseract.so.4.0.0 is the actual file, /usr/lib/libtesseract.so.4 the symlink.

User avatar
cobaka
Posts: 538
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 57 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by cobaka »

@ThruHammer

I thought a little more about what I was doing.
I think everything I wrote in the previous post was incorrect.
The detail below is a snapshot of the files in /lib/, as seen by (or using) ROX.
Note the attributes of the tesseract.so.4 file. Doesn't look 'healthy' to me.
I think I made a link to a non-existent 'something'.

Tesseract-link.jpg
Tesseract-link.jpg (97.23 KiB) Viewed 769 times

I think we're back to square #1. Agree? I will go to jail. I will go directly to jail. I will not pass 'go'. I will not collect $200.
Do you have a 'get-out-of-jail-free' card? (Hope you know 'monopoly')

cobaka

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

User avatar
cobaka
Posts: 538
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 57 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by cobaka »

Using the find command to locate libtesseract.so.4

# find /usr/ -iname tess*
/usr/bin/tesseract
/usr/share/man/man1/tesseract.1.gz
/usr/share/doc/tesseract-ocr
#
Tired. Can't think at the moment. Sorry

cobaka

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

User avatar
mikewalsh
Moderator
Posts: 5742
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 636 times
Been thanked: 1777 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by mikewalsh »

ThruHammer wrote: Fri Mar 12, 2021 10:33 am

It may be expecting to find it in /usr/lib, so run this symlink. More than one is fine.

Code: Select all

ln -s /usr/lib/i386-linux-gnu/libtesseract.so.4.0.0 /usr/lib/libtesseract.so.4

libtesseract.so.4.0.0 is the actual file, /usr/lib/libtesseract.so.4 the symlink.

Figured it out.....finally.

Hallo, Semme! :D :thumbup: (Amazing the number of folks that use a different ID in every new forum.....but the posting "style" never changes...)

Sorry, mate; I just notice stuff like this!

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

User avatar
ThruHammer
Posts: 257
Joined: Sun Jul 12, 2020 1:08 am
Location: Ray Brook, NY
Been thanked: 14 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by ThruHammer »

Wasn't trying to hide. Surprised you didn't pick up on it sooner.

User avatar
ThruHammer
Posts: 257
Joined: Sun Jul 12, 2020 1:08 am
Location: Ray Brook, NY
Been thanked: 14 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by ThruHammer »

Cobaka, is libtesseract.so.4.0.0 on your system and where?

User avatar
mikewalsh
Moderator
Posts: 5742
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 636 times
Been thanked: 1777 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by mikewalsh »

ThruHammer wrote: Fri Mar 12, 2021 11:25 am

Wasn't trying to hide. Surprised you didn't pick up on it sooner.

Slowing down in my old age, mate. It happens..... :lol: (And, er.....welcome back. :D)

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

User avatar
ThruHammer
Posts: 257
Joined: Sun Jul 12, 2020 1:08 am
Location: Ray Brook, NY
Been thanked: 14 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by ThruHammer »

Thank you, Mike! A little reincarnation here'n there does a soul good. :mrgreen:

==

Now Cobaka, I just loaded the latest copy of BionicPup32-8.0, ran pkg manager and installed Tesseract +deps without any issue.

In your shoes I would remove your current Tesseract install, exit pkg manager, go to PPM (pkg manager) settings and update its pkg database.

You'd then exit again, reopen PPM and reinstall Tesseract.

Running ldd should show ZERO missing deps.

Attachments
tesseract_deps.jpg
tesseract_deps.jpg (95.81 KiB) Viewed 744 times
TerryH
Posts: 591
Joined: Mon Jun 15, 2020 2:08 am
Has thanked: 130 times
Been thanked: 137 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by TerryH »

Yes your assumption is correct, the arrow is indicating the file is a symbolic link. If you hover the mouse cursor over the link file, it will show what the linked source item.

New Laptop - ASUS ZenBook Ryzen 7 5800H Vega 7 iGPU / 16 GB RAM

User avatar
mikewalsh
Moderator
Posts: 5742
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 636 times
Been thanked: 1777 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by mikewalsh »

@cobaka :-

Les; RE sym-link theory. Basically, the layout goes like this...

ln -s /path/to/source /path/to/link

......which translates as:-

(link) (sym-link) (the lib you want to link to - full $PATH) (the name of the required link - full $PATH)

Piece of cake once you've done it a few times. You can of course do this with ROX, but I know you're trying to teach yourself Bash & associated 'terminalese', yes..?

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

User avatar
cobaka
Posts: 538
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 57 times

Re: Installing Tesseract OCR package in 32-bit UPupBB - failed.

Post by cobaka »

@ThruHammer

You asked:

Cobaka, is libtesseract.so.4.0.0 on your system and where?

Answer - yes. Location is:
# find / -iname libtesseract.so.4
/lib/libtesseract.so.4

libtesseract.so.4 is certainly a dependency of tesseract: Here is proof:
# ldd /usr/bin/tesseract
linux-gate.so.1 (0xb77b8000)
liblept.so.5 => /usr/lib/liblept.so.5 (0xb74cb000)
libtesseract.so.4 => not found
libopenjp2.so.7 => not found

I changed the order in this list. I removed many files that are dependencies - since they exist they do not interest me.
The point of interest in the list above is that libtesseract.so.4 and libopenjp2.so.7 were not found and
libtesseract.so.4 is found in the directory /lib/
Maybe I should move it to /usr/lib and after that make the symbolic link?
I will think about mike walsh's instruction for writing a link. As he said, it's not as difficult as dying.
(He didn't actually say that - but you know what I mean.)

cobaka

I'm slow answering today, I'm playing amateur plumber.

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

User avatar
mikewalsh
Moderator
Posts: 5742
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 636 times
Been thanked: 1777 times

Re: Installing Tesseract OCR package in 32-bit UPupBB - failed.

Post by mikewalsh »

@cobaka :-

Les:- Have you in fact looked in /lib, to see what's there? It's perfectly possible to have an "orphan" sym-link without the parent dependency it's pointing at, y'know. "Ldd" will still show it as existing, even though the parent library doesn't....

This is one thing I don't know how you would check via terminal, though doubtless there is a way. I'm more of a one for 'visual cues'; I find it simpler to look at a graphical representation of something, than it is to visualize an 'abstract' image in my head, purely from a terminal description of it.... That's just me; it's the way my mind has always worked.

EDIT:- This'll list the contents of lib.....every single item that is in there:-

Code: Select all

ls /lib/

Note the trailing slash; this, I think, tells it to search the contents of whatever directory is immediately in front of it..? I could of course be wrong, though this does do what you want in this instance.

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

User avatar
ThruHammer
Posts: 257
Joined: Sun Jul 12, 2020 1:08 am
Location: Ray Brook, NY
Been thanked: 14 times

Re: Installing Tesseract OCR package in 32-bit UPupBB - failed.

Post by ThruHammer »

Questions? I'm gonna step aside and let Mike continue.

These examples may help you "visualize" the relation.

Attachments
example-1.jpg
example-1.jpg (9.69 KiB) Viewed 826 times
example-2.jpg
example-2.jpg (10.47 KiB) Viewed 826 times
Last edited by ThruHammer on Sun Mar 14, 2021 10:10 am, edited 1 time in total.
User avatar
greengeek
Posts: 1256
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 392 times
Been thanked: 148 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by greengeek »

mikewalsh wrote: Fri Mar 12, 2021 11:04 pm

RE sym-link theory. Basically, the layout goes like this...

ln -s /path/to/source /path/to/link

......which translates as:-

(link) (sym-link) (the lib you want to link to - full $PATH) (the name of the required link - full $PATH)

Piece of cake once you've done it a few times. You can of course do this with ROX, but I know you're trying to teach yourself Bash & associated 'terminalese', yes..?

Mike. ;)

This should be a sticky somewhere (if it's not already...)

User avatar
6502coder
Posts: 90
Joined: Mon Jul 13, 2020 6:21 pm
Location: Western US
Has thanked: 3 times
Been thanked: 22 times

Re: Installing Tesseract OCR package in 32-bit UPupBB - failed.

Post by 6502coder »

It may be overkill, but I wrote a detailed explanation of symlinks for the Puppy Newsletter:

http://smokey01.com/newsletters/2018/Se ... 18.html#11

Note: there's an unfortunate error in this section of the article:

This time we get what we wanted. The symbolic link we created says to replace a reference to the snack.txt file with "../greet.txt", which in turn is interpreted as being relative to the parent directory of the symlink--which is /tmp/stuff2/bar--so the net result is "cat /tmp/stuff2/bar/../food.txt", which amounts to "cat /tmp/stuff2/food.txt" since the descent into the the bar directory is canceled out by the "..".

Here's a further example:
# cd
# cat /tmp/stuff2/bar/snack.txt
Ham and eggs
# cd -
/tmp/stuff2/bar

In this case "/tmp/stuff2/bar/snack.txt" is converted into "../greet.txt", which is interpreted as being relative to the parent directory of the symlink (/tmp/stuff2/bar) and therefore becomes "/tmp/stuff2/bar/../food.txt" which again just amounts to "/tmp/stuff2/food.txt".

In both cases where "../greet.txt" appears, it should be "../food.txt". Only took me 2.5 years to notice that...

User avatar
cobaka
Posts: 538
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 57 times

Re: Installing Tesseract OCR package in 32-bit UPupBB - failed.

Post by cobaka »

@ThruHammer
@6502coder
@mikewalsh

A short note to say this topic is 'still current'. I was away for a few days.
Other tasks were pushed on the job-stack, but after a few 'pops' Tesseract rose to the top.

For 6502-coder: Thank you for the note to your article about symbolic links. I want to learn the theory (and practice) of using symlinks and had already begun to read about these in other places.

To mike: Before I delete Tesseract I will document the content of the library directory.

Thanks to all!

cobaka

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

User avatar
cobaka
Posts: 538
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 57 times

Re: Installing Tesseract OCR package in 32-bit UPupBB - failed.

Post by cobaka »

A joke (or illustration) of stupidity. Gross stupidity.

I installed tesseract on an old Dell notebook while I was in Sydney.
Then I returned to my home and logged onto my desktop box with the intent of following Mike's suggestion: look for installed 'lib' files.

Nothing! Not a single library file for tesseract. Worse still - not even tesseract was on my desk-top box. :oops:
I'm embarrassed by my stupidity!

cobaka.

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

User avatar
mikewalsh
Moderator
Posts: 5742
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 636 times
Been thanked: 1777 times

Re: Installing Tesseract OCR package - failed. Pls help!

Post by mikewalsh »

mikewalsh wrote: Fri Mar 12, 2021 11:04 pm

@cobaka :-

Les; RE sym-link theory. Basically, the layout goes like this...

ln -s /path/to/source /path/to/link

......which translates as:-

(link) (sym-link) (the lib you want to link to - full $PATH) (the name of the required link - full $PATH)

Piece of cake once you've done it a few times. You can of course do this with ROX, but I know you're trying to teach yourself Bash & associated 'terminalese', yes..?

Mike. ;)

I'll re-write that to read:-

(link) (sym-link) (the item you want to link to - full $PATH) (the name of the required link - full $PATH)

.....because, as I know full well, and 6502coder's example clearly demonstrates, you can sym-link pretty much anything (not JUST libs, though these are by far the commonest use of such.)

One word of caution; sym-links won't work on a FAT32 file system. FAT32 simply doesn't support them, that's why.

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

Post Reply

Return to “Users”