【发布时间】:2016-06-08 23:16:04
【问题描述】:
我在同时使用这三个时遇到了问题。我相信 wand 无法识别 ImageMagick 库,但我不确定。
环境: Python 3.5.1 :: Anaconda 4.0.0(64 位) 视窗 7
我采取的设置说明:
- 已安装 ImageMagick-6.9.4-Q8 (x64) 与“C/C++ 开发 检查标题选项。 (安装到 C:\Program 文件\ImageMagick-6.9.4-Q8)
- 设置 MAGICK_HOME envar C:\Program Files\ImageMagick-6.9.4-Q8
- 从 pip 安装了 wand
我的代码:
import wand
...
with wand.image.Image(filename=source_file, resolution=(RESOLUTION, RESOLUTION)) as img:
...
追溯:
Traceback (most recent call last):
File ".\pdf_convert.py", line 31, in <module>
ret = pdf2jpg(f, target_file, 2480)
File ".\pdf_convert.py", line 10, in pdf2jpg
with wand.image.Image(filename=source_file, resolution=(RESOLUTION, RESOLUTION)) as img:
AttributeError: module 'wand' has no attribute 'image'
从我所看到的一切来看,我都遵循了正确的设置说明。我正在使用 64 位版本的 ImageMagick 和 64 位版本的 Anaconda。在我开始使用 Anaconda(在我使用常规的 32 位 Python 和 32 位 ImageMagick 之前)之前,这一直是我的工作。
我有什么遗漏吗?为什么魔杖无法正常工作?
【问题讨论】:
标签: python windows imagemagick anaconda wand