Tesseract install mac os

I am trying to install tesseract on my mac using homeBrew. When I try to install, everything seems good, but I get the following error message:

Warning: Could not link leptonica. Unlinking... Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local You can try again using `brew link leptonica' 

When I try to run the tesseract function, I get the following error:

 Tesseract Open Source OCR Engine v3.02.02 with Leptonica Error in pixReadStreamPng: function not present Error in pixReadStream: png: no pix returned Error in pixRead: pix not read Unsupported image type. 

I have image magic installed, and the command I used to install tesseract was:

 brew install tesseract 

Can anyone tell me what I can do to make tesseract work? Thanks!

EDIT When I run the brew leptonica link, I get the following error:

 Could not symlink file: /usr/local/Cellar/leptonica/1.69/bin/yuvtest Target /usr/local/bin/yuvtest already exists. You may need to delete it. 
+5
source share
4 answers

After installing / uninstalling and reinstalling tesseract, I found a solution for the same problem as yours. In the logs of your terminal when installing tesseract you will see:

Error: brew link step did not complete successfully

The formula is built, but is not symbolically associated with / usr / local. Bin / convertfilestopdf could not be matched. The target / usr / local / bin / convertfilestopdf already exists. You can remove it: rm '/ usr / local / bin / convertfilestopdf'
To force a link and overwrite all conflicting files: brew link --overwrite leptonica

To view all files that will be deleted: brew link --overwrite --dry-run leptonica

What I did: brew link --overwrite leptonica

"Link / usr / local / Cellar / leptonica / 1.71_1 ... 45 symbolic links created

Everything should work fine.

Hope this helps you.

+2
source

It sounds a little silly, but have you tried to remove yuvtest? I just tried this myself - the file is automatically created by the brew leptonica link. As for why it doesn't work, is it possible that you had some version of leptonica / tesseract installed? Another reasonable suggestion for a fix would be

 brew uninstall tesseract; brew install tesseract 

As far as I know, setting image magic should not matter to tesseract. They have nothing to do.

+1
source

Tesseract now depends on the installed Leptonica.

The error messages you see relate to these files:

Leptonica is configured to handle image I / O using these external libraries: libjpeg, libtiff, libpng, libz, libgif, libwebp.

These libraries are easy to obtain. For example, using the debian package manager: sudo apt-get install where = {libpng12-dev, libjpeg62-dev, libtiff4-dev}.

Source: Leptonic Informal Documentation

I found that homebrew will install some, but not all libraries.

0
source

Now, as of January 2019, Tesseract installs normally with homebrew if xquartz, brew cask install xquartz installed first. Then you can do the following: brew install tesseract --with-all-languages --with-serial-num-pack --with-training-tools

0
source

Source: https://habr.com/ru/post/1486535/


All Articles