Python doesn't find MagickWand libraries (despite the correct location?)

I wanted to install the Python ImageMagick API stick and follow this site:

http://docs.wand-py.org/en/latest/guide/install.html#install-imagemagick-on-windows

However, when performing a very simple test:

from wand.image import Image 

I get the following output:

Traceback (last last call):

File "F: \ PATHTO \ Python34 \ lib \ site-packages \ wand \ api.py", line 137, in libraries = load_library ()

File "F: \ PATHTO \ Python34 \ lib \ site-packages \ wand \ api.py", line 107, in load_library raise IOError ('cannot find library, checked paths:' + repr (try_paths))

OSError: Unable to find the library; Simple paths: ['F: \ PATHTO \ ImageMagick-6.8.9-Q16 \ CORE_RL_wand_.dll', 'F: \ PATHTO \ ImageMagick-6.8.9-Q16 \ CORE_RL_wand_HDRI.dll', 'F: \ PATHTO \ ImageMagick- 6.8.9-Q16 \ CORE_RL_wand_-Q16.dll ',' F: \ PATHTO \ ImageMagick-6.8.9-Q16 \ CORE_RL_wand_-Q16HDRI.dll ',' F: \ PATHTO \ ImageMagick-6.8.9-Q16 \ CORE_RL_wand_- Q8.dll ',' F: \ PATHTO \ ImageMagick-6.8.9-Q16 \ CORE_RL_wand_-Q8HDRI.dll ',' F: \ PATHTO \ ImageMagick-6.8.9-Q16 \ CORE_RL_wand_-6.Q16.dll ',' F: \ PATHTO \ ImageMagick-6.8.9-Q16 \ CORE_RL_wand_-6.Q16HDRI.dll ']

When processing the above exception, another exception occurred:

Traceback (last last call): File "D: \ PATHTO \ Python \ test.py", line 1, in import wand.image

File "F: \ PATHTO \ Python34 \ lib \ site-packages \ wand \ image.py", line 20, from .api import MagickPixelPacket, libc, libmagick, library

File "F: \ PATHTO \ Python34 \ lib \ site-packages \ wand \ api.py", line 161, in 'Try installing: \ n' + msg)

ImportError: MagickWand shared library not found. You probably did not install the ImageMagick library. Try installing: http://docs.wand-py.org/en/latest/guide/install.html#install-imagemagick-on-windows

However, files that were found (such as CORE_RL_wand_.dll) are located where they were not found. I seem to have set MAGICK_HOME env. right.

However (which seems wrong) the paths to the api stick and my Python installation are displayed with one backslash on my command line, while the paths to the ImageMagick folder are displayed with two of them.

I donโ€™t understand why this is so (the env. Variable uses single backslashes, like on a linked site), and I donโ€™t know if this is a problem or even related to it.

+10
source share
5 answers

I solved my problem after I thought about it;)

I had a 32-bit version of Python and a 64-bit version of ImageMagick ... after uninstalling ImageMagick and installing the 32-bit version, everything is fine.

Perhaps this helps someone who is facing the same problem and comes here via Google ^^

+19
source

If you had a similar problem, check if the correct architecture was installed, corresponding to python 3.x, and it still did not work. I managed to get it to work using a few steps, and I thought I posted it here, consolidated if anyone had similar problems.

Several sources have reported that Image Magick 7.x is not compatible with magical Wand, so make sure you are using 6.x. In addition, โ€œstaticโ€ suffix versions do not work. The one that finally worked for me was "ImageMagick-6.9.8-10-Q8-x64-dll.exe"

+6
source

I ran into a similar problem, however installing ImageMagick-6.9.xx-Q16-x64-d64.exe is a trick ... so it is quite obvious that ImageMagick-6.9.10-11-Q16-x64-static.exe does not seem to work. .. The architecture for Python & Installer was only 64-bit .....

Remove ImageMagick-6.9.10-11-Q16-x64-static.exe, then install ImageMagick-6.9.xx-Q16-x64-dll.exe

+1
source

Just notice, this works in another case (in my case), I got the same error with 64-bit python and 32-bit Imagemagick. The python architecture (32 or 64 bit) seems to be compatible with ImageMagick's. Note that ghostscript may be 32 bits and still work.

0
source

What I do to work:

  • OS: Windows Server 2012
  • python: 3.7 (32 bits)
  • install imageMagick: ImageMagick-7.0.8-49-Q16-x86-dll (32 bits)
  • install ghostscript: gs927w32 (32 bits)

Add environment path:

  • C: \ Program Files (x86) \ gs \ gs9.27 \ bin

Recommendations:

0
source

Source: https://habr.com/ru/post/972980/


All Articles