I am trying to install tesseract on my mac using homeBrew. When I try installing, everything seems to be 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 running a 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 magick installed and the command I used to install tesseract was:
brew install tesseract
Can anyone please tell me what I can do to get tesseract working? Thank you!
EDIT
When I run brew link leptonica, 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.
Now, as of September 2019, there are no longer any optional install flags available
brew options tesseract
yield nothing. But,
brew info tesseract
yields the following key info:
This formula contains only the "eng", "osd", and "snum" language data files.
If you need all the other supported languages, `brew install tesseract-lang`.
Therefore, to get all of the languages installed, you need to now install a separate library called tesseract-lang.
Updated installation:
brew install tesseract
brew install tesseract-lang
Hope this helps.
old in case this is useful:
Now, as of January 2019, Tesseract installs fine via homebrew, as long as you have xquartz installed first, brew cask install xquartz. Then you can do the following: brew install tesseract --with-all-languages --with-serial-num-pack --with-training-tools
After installing / removing and re-installing tesseract i found the solution for the same problem you have. On your terminal logs, while installing tesseract, you will see:
Error: The brew link step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/convertfilestopdf
Target /usr/local/bin/convertfilestopdf
already exists.
You may want to remove it:
rm '/usr/local/bin/convertfilestopdf'
To force the link and overwrite all conflicting files:
brew link --overwrite leptonica
To list all files that would be deleted:
brew link --overwrite --dry-run leptonica
What i did was running: brew link --overwrite leptonica
"Linking /usr/local/Cellar/leptonica/1.71_1... 45 symlinks created"
Everything should work perfectly.
Hope this can be a help for you
It sounds a bit silly, but have you tried deleting yuvtest? I just tried it myself - the file is automatically generated by brew link leptonica. As for why it isn't working, is it possible you had some version of leptonica/tesseract installed previously? Another reasonable guess at a fix would be
brew uninstall tesseract; brew install tesseract
So far as I know, image magick being installed shouldn't matter for tesseract. They don't have anything in common.
Tesseract is now dependent on Leptonica being installed.
The error messages you are seeing 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: Leptonica unofficial documentation
I found that homebrew would install some but not all of the libraries.
Related
I am unable to compile gdal with hdf4 support using bash on a mac osx el capitan version 10.11.6. I began with the homebrew approach to building gdal described on the osgeo website. Unfortunately, hdf4 is not by default supported by gdal. The hdf format page includes a great description of the hdf4 data structure but fails to help getting support for gdal. I've installed the szip, zlib, and jpeg libraries discussed here, and reviewed the struggles described by /u/dschneiderch here. The github thread lead me to a final link, which is the basis for my current post.
Using homebrew, I have installed hdf4 (brew install homebrew/versions/hdf4 returns a warning that versions was deprecated and homebrew will use science instead). I've been fighting with this gdal problem for a while, and sure enough, homebrew/science/hdf4-4.2.11_2 already installed. So, I linked hdf4 using brew link -overwrite-hdf4, and a warning comes back that it's already been linked.
I used brew remove gdal to start fresh with the install, then followed Shaun's approach in the sig-geo listserv to complete the gdal installation. Thus, my total workflow was:
brew tap homebrew/versions
brew install hdf4
brew link --overwrite hdf4
brew install gdal --complete --enable-unsupported --with-hdf4
Unfortunately, even after linking the overwrite, I get a warning: Warning: gdal: this formula has no --with-hdf4 option so it will be ignored!. The installation continues, though, and homebrew is able to build gdal.
Checking gdalinfo --formats, hdf4 is still not included in the list. Any tips for what else to try?
I've made some progress using this source, in that gdalinfo --formats' now includes HDF4 as a supported product. However, using pyModis to download data, I still pull a GDAL installation has no support for HDF4, please update GDAL` error.
Importantly, though, after installing Macport the following code works well for installing GDAL on Mac with HDF4 support:
sudo port install gdal +hdf4 +hdf5 +netcdf
I first installed octave through brew with the instruction on the office website. One day when I entered brew update && brew upgrade, octave started to upgrade but one error occurred said
You don't have a working TeX binary (tex) installed anywhere in your
PATH, and texi2dvi cannot proceed without one. If you want to use this
script, you'll need to install TeX (if you don't have it) or change
your PATH or TEX environment variable (if you do). See the --help
output for more details.
So I entered brew cask install mactex to install tex and added the Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin to the PATH, when I run tex, it correctly processed:
terminal screenshot
Then I run brew upgrade but the same error occurred again.
I realized that the --without-docs argument may fix this problem but if I want to install docs (since I have already installed tex) what should I do?
I had similar problem while installing another program (not octave) and after looking around I found that I needed to install TeTex (http://www.tug.org/teTeX/) or TexLive, however I decided to install TexLive because TeTex is not mantained anymore...
For me it worked after installing Texlive on the basic configuration. You can follow the instructions over here:
http://www.tug.org/texlive/quickinstall.html
I have OSX 10.10.5 with Octave 3.4.0 running (installed, who knows how, I did it a million different ways through port, file extraction, ftp, homebrew…). I tried to update my Programme (brew install octave or sudo port install octave) and Terminal spits out:
Warning: octave-3.8.2 already installed, it's just not linked
Okay, great. So I have a better programme somewhere installed. What now? How on earth am I supposed to “just link” the newer installation?
If you install octave with Homebrew and it doesn't link it it should tell you why. You can force Homebrew to link octave with
$ brew link --overwrite octave
You can also add the --dry-run option to check and see what Homebrew will do to link octave
$ brew link --overwrite --dry-run octave
A possible reason for Homebrew not linking octave is that you've installed it by another method, MacPorts for instance. It is not recommended that you use both Homebrew and MacPorts on the same system.
I am trying to install imagemagick on OS X Mavericks. When I run brew install imagemagick I get this output at the end:
Warning: Could not link imagemagick. 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 imagemagick'
Possible conflicting files are:
/usr/local/bin/convert
/usr/local/share/man/man1/convert.1
==> Summary
I tried some of the solutions listed here (not all though), but didn't get further. I also tried brew link imagemagick, but I get:
Linking /usr/local/Cellar/imagemagick/6.8.7-7... Warning: Could not link imagemagick. Unlinking...
Error: Could not symlink file: /usr/local/Cellar/imagemagick/6.8.7-7/bin/convert
Target /usr/local/bin/convert already exists. You may need to delete it.
To force the link and overwrite all other conflicting files, do:
brew link --overwrite formula_name
To list all files that would be deleted:
brew link --overwrite --dry-run formula_name
So my question: is it safe to run brew link --overwrite imagemagick? What could go wrong if I overwrite /usr/local/bin/convert?
I had the same problem, and after a bit of investigation, I'm pretty sure that the existing /usr/local/bin/convert was installed with MacTeX, which I did not install through homebrew. Replacing it with the homebrew installed 'convert' worked fine - you might want to back up the existing files beforehand just in case though.
This is my first time trying to compile source code in terminal (I installed gimp using macPorts but this could be part of the problem...?)
I want to install fontforge and I was following these instructions how to install fontforge.
I got this warning while installing brew:
Warning: The following *evil* dylibs exist in /usr/local/lib
They may break builds or worse. You should consider deleting them:
/usr/local/lib/libssl.0.9.8.dylib
I could not find usr/local/lib and the only libssl file was in opt/local/lib called libssl.1.0.0.dylib which is supposed to be hidden apparently...
I made it to the "brew install cairo --use-clang" step, then when I try the "brew install fontforge --use-gcc" step I get the following warning:
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
==> Installing fontforge dependency: gettext
Error: GCC could not be found
when I check gcc version I get:
:~ me$ gcc --V
i686-apple-darwin11-llvm-gcc-4.2: no input files
Do I need to uninstall macports (then re-install gimp?)
I read gcc comes with xcode, I have xcode 4.3 (upgraded after this issue but didn't fix it) so do I have gcc or not? is there another way to check etc.
Can anyone tell me what I am doing wrong (what I broke etc)?
NOTE I also have flashbuilder which has a program called gcc as well (I dont know if this broke the other gcc...)