问题
dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
Referenced from: /usr/local/opt/leptonica/lib/liblept.5.dylib
Reason: Incompatible library version: liblept.5.dylib requires version 54.0.0 or later, but libpng16.16.dylib provides version 29.0.0
Abort trap: 6
Have tried brew reinstall and upgrade, and tesseract reinstall, leptonica reinstall, deleted cache, deleted libs forcing new to be downloaded, nothing works. Not sure if this is a brew problem or leptonica, or the libpng thing. Is this a High Sierra gotcha? High Sierra libpng not compatible with whatever leptonica the same brew is installing? In which case that is brew's fault. Mac Port install leaves same error. Something similar here, but no solution, note date is 2016 http://eeko-amaryllis.hatenablog.com/entry/2016/07/28/181303
回答1:
- google "liblept.5.dylib requires version" in quotes
- gives you three results, the first being the above query, but the second is "Calling external command tesseract resulted in old version of ... " https://fr.mathworks.com/matlabcentral/answers/313225-calling-external-command-tesseract-resulted-in-old-version-of-tesseract-being-executed
the answer there refers to DYLD_LIBRARY_PATH
from terminal window
echo $DYLD_LIBRARY_PATH
/Applications/GIMP.app/Contents/Resources/lib:/Users/your_name_here/Downloads/magic/ImageMagick-7.0.7/lib/
You can check the libs for the offending older version of the dyld, but I knew I hadn't updated GIMP in a while and it wouldn't be surprising to find it used an imaging library. I did confirm by looking at that lib directory the lib was there, updated GIMP, checked ImageMagic wasn't using same lib, and still had to remove the DYD_LIBRARY_PATH reference as new GIMP didn't update it.
来源:https://stackoverflow.com/questions/59014528/tesseract-incompatible-lib-libpng16-16-dylib-brew