1
votes

How to install Tesseract in AWS Linux? One of our team member tried the below commands a few months ago.

cd /opt
mkdir tesseract
chmod 0755 tesseract
cd tesseract

yum install libpng-devel
yum install libtiff-devel
yum install libjpeg-devel
wget http://www.leptonica.com/source/leptonica-1.71.tar.gz 
tar xzf leptonica-1.71.tar.gz
cd leptonica-1.71
./configure
make
make install
export LIBLEPT_HEADERSDIR=/usr/local/include # Add to .profile

cd /opt/tesseract
yum install libtool
wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz
tar xzf tesseract-ocr-3.02.02.tar.gz # Makes tesseract-ocr directory, no version.
cd tesseract-ocr
./autogen.sh
./configure --with-extra-libraries=/opt/tesseract
make
sudo make install
sudo ldconfig

cd /opt/tesseract
wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.eng.tar.gz
tar xzf tesseract-ocr-3.02.eng.tar.gz # Makes tesseract-ocr/tessdata directory.
sudo cp ./tessdata/* /usr/local/share/tessdata/ | for each
$>rm –rf tessdata 
export TESSDATA_PREFIX=/opt/tesseract/tesseract-ocr/

But these commands didn't helped. When we are ran Tesseract OCR for PHP, we got the below error.

Error! The command "tesseract" was not found. Make sure you have Tesseract OCR installed on your system

It will be helpful if someone shares any tutorial/documentation links.

1
What have you tried? What problems are you experiencing?John Rotenstein
I've updated my question. Can you please check and help?Jenz
I have no knowledge of tesseract, but that error is saying that the command you ran is not found. It is probably installed in some directory (eg /usr/local/share/tessdata/), so try running your command from there.John Rotenstein
tesseract is in the EPEL repo fedoraproject.org/wiki/EPEL ... for el6, el7, el8 .Knud Larsen

1 Answers

9
votes

This should work on Amazon Linux 2:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y update
yum -y install tesseract