简体   繁体   English

ImageMagick 和 OS X Lion 问题

[英]ImageMagick and OS X Lion trouble

[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-sl but 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?我能做些什么来解决我的问题?

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/homebrew and its wiki.如果您不知道 brew 是什么,请访问https://github.com/mxcl/homebrew及其 wiki。

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

worked for me为我工作

I too use homebrew for installing packages but imagemagick stopped working after upgrading OSX 10.8 to 10.9 (Mavericks).我也使用自制软件来安装软件包,但在将 OSX 10.8 升级到 10.9(小牛队)后,imagemagick 停止工作。 I had to do the following steps:我必须执行以下步骤:

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

Why the --build-from-source ?为什么是--build-from-source Well for me running brew install imagemagick on its own to install the pre-built binary wasn't sufficient;对我来说, brew install imagemagick运行brew install imagemagick来安装预构建的二进制文件是不够的; it fixed the original 'dyln' error but was replaced with:它修复了原始的“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

I also upgraded to Lion and lost ImageMagick, although i'm getting different errors. 我也升级到 Lion 并丢失了 ImageMagick,尽管我遇到了不同的错误。

\n

i found a Lion distribution on imagemagick.org. 我在 imagemagick.org 上找到了 Lion 发行版 not a big fan of the DYLD_LIBRARY_PATH environment variable but it works. 不是 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

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

For others looking and still having trouble, I used this:对于其他寻找但仍然遇到问题的人,我使用了这个:

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

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 graphicsmagick before installing again.对于谷歌用户:如果你碰巧事先用 brew 安装了它,你需要在再次安装之前通过运行brew uninstall graphicsmagick来重新安装。 Easy.简单。

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

The same problem might occur with OSX Mountain Lion (preview 4). OSX Mountain Lion(预览版 4)可能会出现同样的问题。 I had to configure some parts separately because there are some library incompatibilities:我不得不单独配置一些部分,因为有一些库不兼容:

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=no and 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

I could fix the ImageMagick problem by installing corresponding package from cactuslab site .我可以通过从cactuslab 站点安装相应的包来解决 ImageMagick 问题。

Then by setting the PATH variables in terminal:然后通过在终端中设置PATH变量:

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

If you're using Homebrew , try the following command:如果您使用的是Homebrew ,请尝试以下命令:

brew doctor

to diagnose the common problems.诊断常见问题。

One of it could be to remove DYLD_FALLBACK_LIBRARY_PATH variable from your ~/.profile if you have it.其中之一可能是从您的 ~/.profile 中删除 DYLD_FALLBACK_LIBRARY_PATH 变量(如果有)。

Or you have to re-install libtool by:或者您必须通过以下方式重新安装 libtool:

brew reinstall libtool --universal && brew unlink libtool && brew link libtool

I tried most of the solutions above and they didn't work.我尝试了上面的大多数解决方案,但没有奏效。 Here's how I fixed my problem:这是我解决问题的方法:

brew install imagemagick;
brew install freetype;
cd /usr/X11/lib/;    
sudo mv libfreetype.6.dylib libfreetype.6.dylib.orig;
sudo ln -s /usr/local/opt/freetype/lib/libfreetype.6.dylib libfreetype.6.dylib

Tested on OS X 10.7.2在 OS X 10.7.2 上测试

For 10.7.8 and up, you have to install the php version and not the pecl version.对于 10.7.8 及更高版本,您必须安装 php 版本而不是 pecl 版本。 Depending on your version of php you've install with Macports you can either do:根据您使用 Macports 安装的 php 版本,您可以执行以下任一操作:

sudo port install php-imagick

sudo port install php5-imagick

sudo port install php53-imagick

sudo port install php54-imagick

Remember only to do the one of your current version of php.记住只做你当前版本的 php 之一。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM