Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python wand.image is not recognized

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

like image 208
c.Parsi Avatar asked May 03 '16 18:05

c.Parsi


2 Answers

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.

like image 140
Jerinaw Avatar answered Sep 20 '22 08:09

Jerinaw


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.

like image 37
Bharadwaj Srigiriraju Avatar answered Sep 18 '22 08:09

Bharadwaj Srigiriraju