gpt4 book ai didi

python - 导入错误 : MagickWand shared library not found[windows]

转载 作者:行者123 更新时间:2023-12-04 13:22:06 30 4
gpt4 key购买 nike

早上好,

经过多次尝试运行

from wand.image import Image

我收到以下错误:
    Traceback (most recent call last):
File "C:\Users\XXXXX\PycharmProjects\PDF_convert\venv\lib\site-packages\wand\api.py", line 180, in <module>
libraries = load_library()
File "C:\Users\XXXXX\PycharmProjects\PDF_convert\venv\lib\site-packages\wand\api.py", line 135, in load_library
raise IOError('cannot find library; tried paths: ' + repr(tried_paths))
OSError: cannot find library; tried paths: ['C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\libMagickWand.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_HDRI.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\libMagickWandHDRI.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_HDRI-2.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\libMagickWandHDRI-2.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_-6.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\libMagickWand-6.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_-6HDRI.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\libMagickWand-6HDRI.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_-6HDRI-2.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\libMagickWand-6HDRI-2.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_-Q16.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\libMagickWand-Q16.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_-Q16HDRI.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\libMagickWand-Q16HDRI.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_-Q16HDRI-2.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\libMagickWand-Q16HDRI-2.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_-Q8.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\libMagickWand-Q8.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_-Q8HDRI.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\libMagickWand-Q8HDRI.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_-Q8HDRI-2.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\libMagickWand-Q8HDRI-2.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_-6.Q16.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\libMagickWand-6.Q16.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_-6.Q16HDRI.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\libMagickWand-6.Q16HDRI.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\CORE_RL_wand_-6.Q16HDRI-2.dll', 'C:\\Program Files\\ImageMagick-6.9.9-Q8\\libMagickWand-6.Q16HDRI-2.dll']
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 20, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\xxxxx\PycharmProjects\PDF_convert\venv\lib\site-packages\wand\image.py", line 20, in <module>
from .api import MagickPixelPacket, libc, libmagick, library
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 20, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\XXXX\PycharmProjects\PDF_convert\venv\lib\site-packages\wand\api.py", line 206, in <module>
'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

我已经尝试了一切:
1. 安装最新的二进制文件 ImageMagick-6.9.9-40-Q8-x64-dll (1).exe(勾选所需选项)
2.定义MAGICK_HOME路径为:C:\Program Files\ImageMagick-6.9.9-Q8
3. 重启电脑

并且仍然给我这个错误。

我正在使用 Windows 10,

有人可以帮我解决这个错误吗?我真的需要使用这个库来扫描 ocr pdf。

提前致谢!

最佳答案

引用 this answer here .我有同样的问题,但我有一个 32 位版本的 Python,所以我不得不下载 ImageMagick 的 x86 版本。

关于python - 导入错误 : MagickWand shared library not found[windows],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49894919/

30 4 0