Centos7 install Tesseract-OCR 4.1 error report configure: error: Leptonica 1.74 or higher is required. Solution

<

p style=”font-size:20px”>When installing Tesseract-OCR 4.1 on centos7, we know that the official website only gives a compilation tutorial for ubuntu, and there are many problems with the installation on centos7. The following are the problems I encountered< /p>

1. There is a problem

The problem I encountered is an error:

configure: error: Leptonica 1.74 or higher is required.

2. Solution

Install Leptonica-1.78 from source code, download source code: http://www.leptonica.org/source/leptonica-1.78.0.tar.gz

Because the official website is a foreign country, if you think the download is a bit slow, I have already downloaded it in advance. Download address: leptonica-1.78.0.tar.gz

# Download with wget command
wget -c -t 20 https://www.ivdone.top/wordpress/pic/p1538/leptonica-1.78.0.tar.gz

Compile and install:

Install the dependencies first, otherwise an error will be reported:

yum install libjpeg-devel
yum install libpng-devel
yum install libtiff-devel
# Compile and install
tar -zxvf leptonica-1.78.0.tar.gz
cd leptonica-1.78.0/
./configure --prefix=/usr/local/
make
make install

Configure environment variables:

# Configure environment variables
vi /etc/profile

Add the following environment variables to the file and export:

export LD_LIBRARY_PATH=$LD_LIBRARY_PAYT:/usr/local/lib
export LIBLEPT_HEADERSDIR=/usr/local/include
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Update environment variables:

source /etc/profile

3. Test

Re-enter the tesseract-4.1.1 directory

./autogen.sh
./configure --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/include
make && make install
# Version test
tesseract -v

0

Leave a Reply

Your email address will not be published.