71

[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.


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

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.

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.

$ 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?

3
  • This is clearly not too general. This is about a missing library: /opt/local/lib/libltdl.7.dylib. It should not have been closed. Oct 25, 2013 at 14:41
  • 1
    If you upgraded XCode, be sure to reinstall the Command Line Tools as recommended here: stackoverflow.com/a/6784216/102401. Also, I agree this should be reopened. I'm trying to tackle a specific programming issue where a script started reporting problems with ImageMagick and this is the first thing that came up when searching. None of the answers below worked, but I can't what did because the question is closed. Oct 31, 2013 at 15:45
  • Agreed, I might be able to reword the question as a programming question see if it gets reopen
    – rroche
    Oct 31, 2013 at 16:50

13 Answers 13

172

On 10.8 I solved this issue with:

brew install libtool --universal
brew link libtool

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

8
  • 10
    Don't forget to install xquartz.macosforge.org/landing as well. And you're good to go
    – user191766
    Jul 27, 2012 at 9:14
  • Worked for me without linking. Feb 5, 2013 at 22:01
  • @user192411, because ImageMagick require libtool to be compiled.
    – LevB
    Feb 7, 2013 at 19:00
  • 2
    Just brew install libtool appears to works just as well... Why the --universal and manual link call afterwards?
    – lhunath
    Feb 9, 2013 at 14:47
  • 5
    This worked for me, though I had to do a brew link libtool --force since it was bitching about Keg-only installations. brew doctor also bitches about libtool. What's that about?
    – Drew
    Feb 17, 2013 at 12:25
66
brew uninstall imagemagick
brew install imagemagick --build-from-source

worked for me

6
  • this is not necessary just do a brew install libtool (since the precompiled imagemagick misses to download this dependency)
    – bernstein
    Feb 10, 2013 at 0:58
  • 3
    This worked for me too, thanks. even the brew install libtool was not working.
    – SJP
    Mar 4, 2013 at 20:58
  • Saved my build of octave. I also had to do brew unlink libtool && brew link libtool, brew uninstall imagemagick, brew install imagemagick --build-from-source, then brew link --overwrite imagemagick` Jun 12, 2014 at 22:52
  • reinstalling libtool did not help me, but this worked.
    – Meekohi
    Jun 30, 2014 at 20:36
  • Worked for me on Mavericks (10.9.3).
    – Jonik
    Aug 21, 2014 at 14:15
30

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:

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 imagemagick on its own to install the pre-built binary wasn't sufficient; it fixed the original 'dyln' error but was replaced with:

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
3
  • 3
    I was getting this error with PNGs despite having libpng installed. Just doing the --build-from-source fixed it. :)
    – fregas
    Mar 27, 2014 at 19:56
  • 1
    I think all you need is to relink the packages. See this answer for a suggestion: apple.stackexchange.com/questions/123900/…
    – Pedro
    Sep 6, 2014 at 5:30
  • holy, you just solved me so much headache! currently this is the correct answer. Dec 6, 2014 at 1:38
27

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

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

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

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
4
  • 1
    Howdy I tried this on a fresh Mountain lion install and it fails at the configuration stage configure: error: libltdl is required for modules build. I am relatively new to compiling and installing binaries from source, can you provide a suggested best method to installing the required libltdl library?
    – Rider_X
    Nov 8, 2012 at 16:18
  • 3
    I had originally used the install script mentioned by @rroche on my snow leopard install. After the Lion upgrade i was able to use the code above because i had all the library dependencies installed already. The above code will NOT work on a fresh install.
    – firien
    Nov 9, 2012 at 18:30
  • the script mentioned by @23inhouse appears to work on mountain lion
    – firien
    Nov 9, 2012 at 18:32
  • I ended up installing the command line tools from Xcode, which seems to install a relatively recent version of ImageMagick.
    – Rider_X
    Nov 12, 2012 at 0:38
18

On Mountain Lion OSX,

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

so i fixed it using the following commands

brew uninstall libtool
brew install libtool --universal
brew link libtool --force
1
  • universal gives a single binary file which can be used for both 32bit and 64bit architectures. I think this is needed for Imagemagick to work. Apr 12, 2013 at 10:48
8

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

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

1
  • This doesnt play as nice with homebrew, as linkingvia brew link is done. Manual links might/may/likely willl need to be done afterwards for complete access Jan 12, 2013 at 19:00
7

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

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. Easy.

7

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

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
1
  • and on El Capitan (10.11). I additionally needed to chown -R myusername a few folders (/usr/local/bin, /usr/local/share, /usr/local/etc), and replace the last line with brew unlink pillow && brew link pillow. Thanks a ton!
    – michele b
    Nov 24, 2015 at 10:42
4

The same problem might occur with OSX Mountain Lion (preview 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:

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
0
4

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

Then by setting the PATH variables in terminal:

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

If you're using Homebrew, try the following command:

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.

Or you have to re-install libtool by:

brew reinstall libtool --universal && brew unlink libtool && brew link libtool
1
  • 1
    Thanks dude brew doctor was the answer, I actually have other libraries being link.
    – marman
    Mar 12, 2015 at 22:24
1

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

2
1

For 10.7.8 and up, you have to install the php version and not the pecl version. Depending on your version of php you've install with Macports you can either do:

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.