Error When installing Tesseract 3.05 in Centos7 "error: Leptonica 1.74 or higher is required. Try to install libleptonica-dev package"
Asked Answered
B

2

6

We had initially installed tesseract 3.04 in centos 7, and know switching to tesseract 3.05. We have un-installed the older versions and have already installed leptonica-1.75.3 downloaded from leptonica home site.

But, when we go for installing tesseract 3.05, we get following error checking for LEPTONICA... no configure: error: Leptonica 1.74 or higher is required. Try to install libleptonica-dev package.

when running ./configure in console in tesseract-3.05.01 folder.

Need to know, where the issue is.

Bibliogony answered 5/3, 2018 at 10:2 Comment(0)
M
26

The configure script uses pkg-config to see if the leptonica libs are installed (and have the required version).

After you have compiled and installed leptonica from source code you have to manually tell pkg-config where to find the lept.pc config file which is installed with leptonica. Set the PKG_CONFIG_PATH environment variable so it points to the location of lept.pc. If you installed leptonica to its default location you should do:

$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/

before running configure for tesseract.

Marnie answered 7/3, 2018 at 20:55 Comment(4)
Saved my day. Cheers.Allegiance
This is also needed when installing without root (in a local dir in $HOME). See github.com/tesseract-ocr/tesseract/wiki/CompilingHerschelherself
I am getting the same error even after running export commandDan
It's working fine. solved my biggest issue! Thanks, man...Posthumous
N
0

Mine would not work until I did the following copy commands. My Leptonica was installed in the leptonica-1.83.0 directory, yours may be different.

cp /usr/local/leptonica-1.83.0/lib/pkgconfig/lept.pc /usr/lib64/pkgconfig/

cp -a /usr/local/leptonica-1.83.0/lib/liblept /usr/lib64

Also set:

export PKG_CONFIG_PATH=/usr/local/leptonica-1.83.0/lib/pkgconfig

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/leptonica-1.83.0/lib

export LIBLEPT_HEADERSDIR=/usr/local/leptonica-1.83.0/include/leptonica

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/leptonica-1.83.0/lib/pkgconfig

export PKG_CONFIG_PATH=/usr/local/leptonica-1.83.0/lib/pkgconfig/

Then it worked.

Nickolenicks answered 4/1, 2023 at 2:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.