问题描述
我想安装Python ImageMagick API魔杖并关注此网站:
I wanted to install the Python ImageMagick API wand and followed this site:
然而,当运行一个非常简单的测试时:
However, when running a very simple test:
from wand.image import Image
我得到以下输出:
文件F:\ PATTTO \ Python34 \lib\site-packages \ wand \ api.py,第137行,
库= load_library()
File "F:\PATHTO\Python34\lib\site-packages\wand\api.py", line 137, in libraries = load_library()
文件F :\ PATHTO \Python34 \lib \ site-packages \\\\\\\,第107行,在load_library中
引发IOError('找不到库;试过路径:'+ repr(trying_paths) ))
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:找不到库;尝试过的路径:['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 \ COORE_RL_wand_-Q16HDRI.dll','F:\\ \\ PATATHTO \ ImageMagick-6.8.9-Q16\CORE_RL_wand_-Q8.dll','F:\ PATTAT \ ImageMagick-6.8.9-Q16\CORE_RL_wand_-Q8HDRI.dll','F:\ PATATTO \ ImageMagick-6.8.9-Q16\CORE_RL_wand_-6.Q16.dll','F:\ PATHTO \ ImageMagick-6.8.9-Q16\CORE_RL_wand_-6.Q16HDRI.dll']
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(最近一次调用最后一次):
文件D:\ PATTTO\Python\test.py,第1行,
导入wand.image
Traceback (most recent call last): File "D:\PATHTO\Python\test.py", line 1, in import wand.image
文件F:\ PATATTO \ Pithon34 \lib\site-packages \ wand \ image.py,第20行,$来自.api的b $ b导入MagickPixelPacket,libc,libmagick,库
File "F:\PATHTO\Python34\lib\site-packages\wand\image.py", line 20, in from .api import MagickPixelPacket, libc, libmagick, library
文件F:\ PATTTO \Python34 \lib \site-packages \ thewand \ api.py,第161行,
'尝试安装:\ n'+ msg)
File "F:\PATHTO\Python34\lib\site-packages\wand\api.py", line 161, in 'Try to install:\n ' + msg)
ImportError:找不到MagickWand共享库。
您可能没有安装ImageMagick库。
尝试安装:
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环境变量是正确的。
The is though, that the files that were tried to be found (e.g. CORE_RL_wand_.dll) are in the very place that they were not found in.So it seems I set the MAGICK_HOME env. variable correctly.
然而(似乎显示不正确)wand api和我的Python安装的路径在我的命令行中显示一个反斜杠,而显示ImageMagick文件夹的路径,其中包含两个。
However (what seems to be displayed incorrectly) the paths to the wand api and to my Python installation are displayed with a single backslash in my commandline, while the paths to the ImageMagick folder are displayed with two of them.
我不明白为什么会这样(env。变量使用链接网站中的单个反斜杠) )我不知道这是问题还是与之相关。
I don't understand why this is the case (the env. variable uses single backslashes as in the linked site) and I don't know whether this is the problem or even related to it.
推荐答案
我在思考后解决了自己的问题关于它;)
I solved my own problem after THINKING about it ;)
我有32位版本的Python和64位版本的ImageMagick ......卸载ImageMagick并安装32位版本后一切都很好。
I had the 32bit version of Python and the 64bit version of ImageMagick... after uninstalling ImageMagick and installing the 32bit version everything is fine.
也许这可以帮助遇到同样问题并通过Google来到这里的人^^
Maybe this helps someone who runs into the same problem and comes here via Google ^^
这篇关于Python没有找到MagickWand Libraries(尽管位置正确?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!