macos ImageMagick 和 OS X Lion 问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7412208/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 08:25:11  来源:igfitidea点击:

ImageMagick and OS X Lion trouble

macosimagemagickhomebrewosx-liondyld

提问by rroche

[edit]I was troubleshooting problems with my development environment when I noticed one of my problems was the dependency on ImageMagick, since it's a vital part of my app.

[编辑]当我注意到我的问题之一是对 ImageMagick 的依赖时,我正在解决我的开发环境问题,因为它是我的应用程序的重要组成部分。



After upgrading to OS X Lion (10.7) i no longer had ImageMagick available, i then tried installing again using MacPorts without success, i then installed from source, and the install wasn't very successfully i had convert and identify but it output error messages that i unfortunately dont have anymore, i by some strange reason decided to remove all of my MacPort libraries and started using Homebrew, i tried installing ImageMagick, it installs OK but when i try to use it throws this error

升级到 OS X Lion (10.7) 后,我不再有 ImageMagick 可用,然后我尝试使用 MacPorts 再次安装但没有成功,然后我从源代码安装,并且安装不是很成功我已经转换和识别但它输出错误消息不幸的是,我不再拥有了,我出于某种奇怪的原因决定删除我所有的 MacPort 库并开始使用 Homebrew,我尝试安装 ImageMagick,它安装正常,但是当我尝试使用它时会引发此错误

dyld: Library not loaded: /opt/local/lib/libltdl.7.dylib
  Referenced from: /usr/local/bin/convert
  Reason: Incompatible library version: convert requires version 11.0.0 or later, but libltdl.7.dylib provides version 10.0.0
Trace/BPT trap: 5

I read online but i have no clue on whats going on here, i found that libltdl is called libtool, and that i obviously need to upgrade it to a newer version, but i havent found any indication of how or where to find the source, or if this should be already be handled by homebrew and why it hasn't.

我在网上阅读,但我不知道这里发生了什么,我发现 libltdl 被称为 libtool,而且我显然需要将它升级到更新的版本,但我还没有找到任何关于如何或在哪里找到源的迹象,或者如果这应该已经由自制软件处理了,为什么还没有。

I tried installing ImageMagick again from source using this installer script https://github.com/masterkain/ImageMagick-slbut when i try to use convert it throws a similar error.

我尝试使用此安装程序脚本 https://github.com/masterkain/ImageMagick-sl从源代码再次安装 ImageMagick,但是当我尝试使用 convert 时,它会引发类似的错误。

$ convert gnome.jpg -resize 50% gnome_.jpg
dyld: Library not loaded: /opt/local/lib/libltdl.7.dylib
  Referenced from: /usr/local/bin/convert
  Reason: Incompatible library version: convert requires version 11.0.0 or later, but libltdl.7.dylib provides version 10.0.0
Trace/BPT trap: 5

$ which convert
/usr/local/bin/convert

What can i do to solve my problem?

我能做些什么来解决我的问题?

采纳答案by firien

I also upgraded to Lion and lost ImageMagick, although i'm getting different errors.

我也升级到 Lion 并丢失了 ImageMagick,尽管我遇到了不同的错误。

i found a Lion distributionon imagemagick.org. not a big fan of the DYLD_LIBRARY_PATH environment variable but it works.

我在 imagemagick.org 上找到了Lion 发行版。不是 DYLD_LIBRARY_PATH 环境变量的忠实粉丝,但它有效。

ok scratch that. i just downloaded the ImageMagick source and re-compiled:

好的划伤那个。我刚刚下载了 ImageMagick 源代码并重新编译:

cd /tmp
curl -OL ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar -xzf ImageMagick.tar.gz
cd ImageMagick-6.7.2-7/
./configure --prefix=/usr/local --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --disable-openmp --with-gs-font-dir=/usr/local/share/ghostscript/fonts
make
sudo make install

回答by LevB

On 10.8 I solved this issue with:

在 10.8 我解决了这个问题:

brew install libtool --universal
brew link libtool

If you don't know what brew is, visit https://github.com/mxcl/homebrewand its wiki.

如果您不知道 brew 是什么,请访问https://github.com/mxcl/homebrew及其 wiki。

回答by jesuisbonbon

brew uninstall imagemagick
brew install imagemagick --build-from-source

worked for me

对我来说有效

回答by arooaroo

I too use homebrew for installing packages but imagemagick stopped working after upgrading OSX 10.8 to 10.9 (Mavericks). I had to do the following steps:

我也使用自制软件来安装软件包,但在将 OSX 10.8 升级到 10.9(小牛队)后,imagemagick 停止工作。我必须执行以下步骤:

brew uninstall imagemagick
brew uninstall libtool
brew install libtool --universal
brew install imagemagick --build-from-source

Why the --build-from-source? Well for me running brew install imagemagickon its own to install the pre-built binary wasn't sufficient; it fixed the original 'dyln' error but was replaced with:

为什么--build-from-source?对我来说,单独运行brew install imagemagick来安装预构建的二进制文件是不够的;它修复了原始的“dyln”错误,但被替换为:

unable to load module `/usr/local/Cellar/imagemagick/6.8.7-7/lib/ImageMagick//modules-Q16/coders/png.la': file not found @ error/module.c/OpenModule/1277

回答by arun15thmay

On Mountain Lion OSX,

在 Mountain Lion OSX 上,

Even with the updated brew for imagemagick(which includes libtool), this error seemed to happen to me.

即使更新了 imagemagick(包括 libtool)的 brew,这个错误似乎也发生在我身上。

so i fixed it using the following commands

所以我使用以下命令修复了它

brew uninstall libtool
brew install libtool --universal
brew link libtool --force

回答by 23inhouse

For others looking and still having trouble, I used this:

对于其他寻找但仍然遇到问题的人,我使用了这个:

https://github.com/maddox/magick-installer

https://github.com/maddox/magick-installer

回答by timoxley

On 10.8, with brew, I solved this issue with:

在 10.8 上,使用 brew,我解决了这个问题:

brew install graphicsmagick

For the googlers: If you happened to have it installed with brew beforehand, you'll need to reinstall by running brew uninstall graphicsmagickbefore installing again. Easy.

对于 googlers:如果你碰巧事先用 brew 安装了它,你需要brew uninstall graphicsmagick在再次安装之前通过运行来重新 安装。简单。

回答by Stanislav Pisockij

This helped me after restoring OS X 10.9.3 from time machine.

从 Time Machine 恢复 OS X 10.9.3 后,这对我有所帮助。

brew uninstall imagemagick
brew uninstall libtool
brew install libtool --universal
brew unlink libtool && brew link libtool
brew install imagemagick
brew install Homebrew/python/pillow
brew link --overwrite pillow

回答by Raghava Kotekar

I could fix the ImageMagick problem by installing corresponding package from cactuslab site.

我可以通过从cactuslab 站点安装相应的包来解决 ImageMagick 问题。

Then by setting the PATHvariables in terminal:

然后通过PATH在终端中设置变量:

export MAGICK_HOME="/usr/local/ImageMagick/"
export PATH="$MAGICK_HOME/bin:$PATH"
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"

回答by teezee

The same problem might occur with OSX Mountain Lion (preview 4). I had to configure some parts separately because there are some library incompatibilities:

OSX Mountain Lion(预览版 4)可能会出现同样的问题。我不得不单独配置一些部分,因为有一些库不兼容:

dyld: Library not loaded: /usr/local/lib/libjpeg.8.dylib
  Referenced from: /usr/local/bin/convert
  Reason: Incompatible library version: convert requires version 13.0.0 or later, but libjpeg.8.dylib provides version 9.0.0

I had to add --with-fontconfig=no, --with-lzma=noand use /opt/local/share/...instead of /usr/local/share/...for the ghostscript fonts:

我不得不添加--with-fontconfig=no,--with-lzma=no并使用/opt/local/share/...代替/usr/local/share/...ghostscript 字体:

cd /tmp
curl -OL ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar -xzf ImageMagick.tar.gz
cd ImageMagick-6.7.8-0/
./configure --prefix=/usr/local --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --disable-openmp --with-fontconfig=no --with-gs-font-dir=/opt/local/share/ghostscript/fonts --with-lzma=no
make
sudo make install