gpt4 book ai didi

Python 找不到 MagickWand 库(尽管位置正确?)

转载 作者:太空狗 更新时间:2023-10-29 18:16:04 26 4
gpt4 key购买 nike

我想安装 Python ImageMagick API wand 并关注了这个网站:

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

但是,当运行一个非常简单的测试时:

from wand.image import Image

我得到以下输出:

Traceback (most recent call last):

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; tried paths: ' + repr(tried_paths))

OSError: cannot find library; tried 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']

During handling of the above exception, another exception occurred:

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

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

File "F:\PATHTO\Python34\lib\site-packages\wand\api.py", line 161, in '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

不过,试图找到的文件(例如 CORE_RL_wand_.dll)就在找不到它们的地方。所以看来我设置了 MAGICK_HOME 环境。变量正确。

但是(似乎显示不正确)wand api 和我的 Python 安装的路径在我的命令行中显示为一个反斜杠,而 ImageMagick 文件夹的路径显示为其中两个。

我不明白为什么会这样(环境变量使用链接站点中的单反斜杠),我不知道这是否是问题所在,甚至与此相关。

最佳答案

经过思考,我解决了自己的问题;)

我有 32 位版本的 Python 和 64 位版本的 ImageMagick...卸载 ImageMagick 并安装 32 位版本后一切正常。

也许这可以帮助遇到同样问题并通过 Google 来到这里的人 ^^

关于Python 找不到 MagickWand 库(尽管位置正确?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25003117/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com