15

I installed Imagemagic (both 32 and 64 bits versions were tried) and then used pip to install wand, I also set the Magick_Home env. variable to imagemagic address but when I run

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "c:\Anaconda2\lib\site-packages\wand\image.py", line 20, in <module> from .api import MagickPixelPacket, libc, libmagick, library File "c:\Anaconda2\lib\site-packages\wand\api.py", line 205, in <module> 'Try to install:\n ' + msg) ImportError: MagickWand shared library not found. You probably had not installed ImageMagick library. Try to install: http://docs.wand-py.org/en/latest/guide/install.html#install-imagemagick-on-windows

c.Parsi
  • 771
  • 2
  • 9
  • 26

5 Answers5

47

For those on mac and using homebrew, it seems like Wand doesn't support imagemagick 7 yet as mentioned in other answers.

There's a new brew formula for Imagemagick 6 which can be used to install the older version in the meanwhile:

brew install imagemagick@6

Create a symlink to this newly installed dylib file as mentioned in other answer to get things working.

ln -s /usr/local/Cellar/imagemagick@6/<your specific 6 version>/lib/libMagickWand-6.Q16.dylib /usr/local/lib/libMagickWand.dylib

Tested on Sierra and seems to be working fine.

Pullie
  • 2,685
  • 3
  • 25
  • 31
Bharadwaj Srigiriraju
  • 2,196
  • 4
  • 25
  • 45
  • 13
    This worked for me, but I didn't need the symlink - just `export MAGICK_HOME=/usr/local/opt/imagemagick@6` in my shell config – Greg May 03 '17 at 08:16
  • @Greg, for some reason adding that to my `.profile` still doesn't work. I still need to export it right on my terminal every time. I'm using iterm2. – majidarif May 29 '17 at 17:02
  • 1
    Forbidden Overseer solution works. Small tip: make sure you create the correct symbolic link. As in: don't assume you have the 6.9.8-4 version. In my case it was 6.9.9-5_1 version. Rookie mistake. – Pullie Aug 08 '17 at 14:22
  • 1
    This is the right answer. Great job. It should be noted that Wand is (as of this writing) incompatible with ImageMagick 7, hence, you need to install imagemagick@6. Do a $brew search imagemagick to see the other version options available :) – John Doe Oct 15 '17 at 02:21
  • 1
    This answer was the end of a one-hour search! Thank you :) – Josh Clark Jul 24 '23 at 18:01
18

ImageMagick Version 7 is a very recent major release. It'll take some time for the community behind (and other bindings) to update core libraries.

For now, you'll have to install the last release of Version 6 (ImageMagick-6.9.8-9-Q16-x64-dll.exe) from http://www.imagemagick.org/download/binaries/

Delimitry
  • 2,987
  • 4
  • 30
  • 39
emcconville
  • 23,800
  • 4
  • 50
  • 66
  • The link in the answer is outdated. Here is the link to the latest 6.x version as of `07/19/2016`: [ImageMagick-6.9.5-2-Q16-x64-dll.exe](http://www.imagemagick.org/download/binaries/ImageMagick-6.9.5-2-Q16-x64-dll.exe) Thank you [emcconville](http://stackoverflow.com/users/438117/emcconville) – Felix Jul 19 '16 at 19:31
  • The commented link is also outdated. Any other source? – majidarif Aug 17 '16 at 03:15
  • @majidarif - Navigate to the parent directory of the link(s) to view all latest binary builds. As of 08/17/2016 the version is [ImageMagick-6.9.5-7-Q16-x64-dll.exe](http://www.imagemagick.org/download/binaries/ImageMagick-6.9.5-7-Q16-x64-dll.exe) – emcconville Aug 17 '16 at 13:10
  • Yeah. I realized. Thanks. – majidarif Aug 17 '16 at 13:41
  • 1
    @Tarocco Checkout the [C-API refactor branch](https://github.com/dahlia/wand/pull/347). Windows + IM7 has been build, but nobody has offered to help test it. – emcconville May 30 '18 at 20:55
1

For me on my Mac I had to (found Wand looks for MAGICK_HOME in Wand source):

export MAGICK_HOME="/usr/local/Cellar/imagemagick@6/6.9.9-31"

That was after installing version 6 of imagemagick. I took a look at the Python source for Wand that was installed after I ran pip3 install Wand. The scripts were looking for imagemagick 6 (I attempted to add 7 into the list of versions it looks for, but got a "wrong version" error).

brew tap homebrew/versions
brew install imagemagick@6

Now, imagemagick version 6 is installed and Wand looks in $MAGICK_HOME for the libraries.

Jerinaw
  • 5,260
  • 7
  • 41
  • 54
0

For M1 macs, the path you want would be export MAGICK_HOME="/opt/homebrew/Cellar/imagemagick@6/6.9.12-61"

Alec Gerona
  • 2,806
  • 1
  • 24
  • 24
-1

I have found a solution. The problem is:

Wand try to find a file like that: libMagickWand.dylib in /usr/local/lib/

But if you install ImageMagick with Homebrew, the file generated is libMagickWand-6.Q16.dylib And Wand never find it.

So, you have 2 solutions:

  1. Create a symbol link from libMagickWand-7.Q16.dylib to libMagickWand.dylib
  2. You can install by MacPorts or from binaries testing that they create the file.

I have installed the ImageMagick for The Capitan from: http://cactuslab.com/assets/installers/ImageMagick-6.9.1-0.pkg.zip and I declare:

export MAGICK_HOME=/opt/ImageMagick