ImageMagick:dyld:未加载库。原因:未找到图片

时间:2017-11-24 18:32:50

标签: macos imagemagick imagemagick-convert dyld

  1. 我从https://www.imagemagick.org/script/download.php#macosx
  2. 下载了ImageMagick
  3. 将其提取到〜/ Documents / software
  4. 我的.profile看起来像这样:
  5. export MAGICK_HOME="~/Documents/software/ImageMagick-7.0.7"
    export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"
    export PATH="$MAGICK_HOME/bin:$PATH"
    
    1. 当我运行convert时,我得到:
    2.   

      dyld:未加载库:   /ImageMagick-7.0.7/lib/libMagickCore-7.Q16HDRI.4.dylib
        参考自:/Users/oa/Documents/software/ImageMagick-7.0.7/bin/convert
        原因:找不到图像   中止陷阱:6

2 个答案:

答案 0 :(得分:5)

根据@Mark Setchell的建议,解决方案是将~替换为$HOME。因此,导出命令应为:

export MAGICK_HOME="$HOME/Documents/software/ImageMagick-7.0.7"
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"
export PATH="$MAGICK_HOME/bin:$PATH"

答案 1 :(得分:0)

对于那些不使用 brew 的人,使用 otool -L 显示问题:

    /ImageMagick-7.0.10/lib/libMagickCore-7.Q16HDRI.8.dylib (compatibility version 9.0.0, current version 9.0.0)
    /ImageMagick-7.0.10/lib/libMagickWand-7.Q16HDRI.8.dylib (compatibility version 9.0.0, current version 9.0.0)
    /opt/X11/lib/libfreetype.6.dylib (compatibility version 19.0.0, current version 19.6.0)
    /opt/X11/lib/libpng16.16.dylib (compatibility version 43.0.0, current version 43.0.0)
    /opt/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
    /opt/X11/lib/libXt.6.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.0.0)
    /opt/X11/lib/libSM.6.dylib (compatibility version 7.0.0, current version 7.1.0)
    /opt/X11/lib/libICE.6.dylib (compatibility version 10.0.0, current version 10.0.0)
    /opt/X11/lib/libX11.6.dylib (compatibility version 10.0.0, current version 10.0.0)