Я пытаюсь использовать ImageMagick в Python3.7, используя привязку Wand.Я успешно установил ImageMagick & Wand (pip install, версия: 0.5.7), но постоянно получаю сообщение об ошибке:
'AttributeError: function' MagickCompareImagesLayers 'not found'
Я выполнил следующие шаги, указанные в официальном документе Wand (ссылка здесь) !:
1) Установлен бинарный файл ImageMagick с официального сайта (windows, 64-битная версия)
2) После установки добавили путь к системным переменным с именем 'MAGICK_HOME'
3) Установленный Wand с помощью pip
Config:
- platform.attribute () - ('64bit'), «WindowsPE»);
- Python3.7.4;
- Жезл == 0,5,7;
- ImageMagick-6.9.10-35-Q8-x64-dll
Выполнение следующей команды после вышеуказанных шагов:
from wand.image import Image
приводит к следующей ошибке:
Traceback (most recent call last):
File "", line 1, in from wand.image import Image
File "c:\users\surya\appdata\local\programs\python\python37\lib\site-packages\wand\image.py", line 18, in from . import assertions
File "c:\users\surya\appdata\local\programs\python\python37\lib\site-packages\wand\assertions.py", line 125, in from .color import Color # noqa: E402
File "c:\users\surya\appdata\local\programs\python\python37\lib\site-packages\wand\color.py", line 10, in from .api import library
File "c:\users\surya\appdata\local\programs\python\python37\lib\site-packages\wand\api.py", line 205, in traceback.format_exc())
ImportError: MagickWand shared library not found or incompatible Original exception was raised in: Traceback (most recent call last): File "c:\users\surya\appdata\local\programs\python\python37\lib\site-packages\wand\api.py", line 196, in magick_image.load(library, IM_VERSION.value) File "c:\users\surya\appdata\local\programs\python\python37\lib\site-packages\wand\cdefs\magick_image.py", line 228, in load lib.MagickCompareImagesLayers.argtypes = [c_void_p, c_int] File "c:\users\surya\appdata\local\programs\python\python37\lib\ctypes__init__.py", line 377, in getattr func = self.getitem(name) File "c:\users\surya\appdata\local\programs\python\python37\lib\ctypes__init__.py", line 382, in getitem func = self._FuncPtr((name_or_ordinal, self)) AttributeError: function 'MagickCompareImagesLayers' not found
Getting the following error:
Traceback (most recent call last):
File "<ipython-input-7-4c9b1a6583e4>", line 1, in <module>
from wand.image import Image
File "c:\users\surya\appdata\local\programs\python\python37\lib\site-packages\wand\image.py", line 18, in <module>
from . import assertions
File "c:\users\surya\appdata\local\programs\python\python37\lib\site-packages\wand\assertions.py", line 125, in <module>
from .color import Color # noqa: E402
File "c:\users\surya\appdata\local\programs\python\python37\lib\site-packages\wand\color.py", line 10, in <module>
from .api import library
File "c:\users\surya\appdata\local\programs\python\python37\lib\site-packages\wand\api.py", line 205, in <module>
traceback.format_exc())
ImportError: MagickWand shared library not found or incompatible
Original exception was raised in:
Traceback (most recent call last):
File "c:\users\surya\appdata\local\programs\python\python37\lib\site-packages\wand\api.py", line 196, in <module>
magick_image.load(library, IM_VERSION.value)
File "c:\users\surya\appdata\local\programs\python\python37\lib\site-packages\wand\cdefs\magick_image.py", line 228, in load
lib.MagickCompareImagesLayers.argtypes = [c_void_p, c_int]
File "c:\users\surya\appdata\local\programs\python\python37\lib\ctypes\__init__.py", line 377, in __getattr__
func = self.__getitem__(name)
File "c:\users\surya\appdata\local\programs\python\python37\lib\ctypes\__init__.py", line 382, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'MagickCompareImagesLayers' not found