我只是希望能够导入 Wand 并在 Mac 上的 Python 上使用它,但这似乎不再可能了。
我已经更新并清理了自制程序,然后运行brew install imagemagick@6
然后我export MAGICK_HOME=/opt/homebrew/Cellar/imagemagick@6/6.9.12-40因为那是我的 imagemagick 所在的位置。
我还安装了最新版本的 wand,然后当我尝试from wand.image import Image在 python3 中执行操作时,我收到此错误消息:
OSError: cannot find library; tried paths: [ ... ]
Run Code Online (Sandbox Code Playgroud)
其中...包含我可以看到的正确路径,其中包含 imagemagick 的文件。
那么,如果路径是正确的,为什么 Wand 仍然不起作用呢?
我发现在通过homebrew安装ImageMagick的macOS V12.2.1wand上使用任何 Python 之前我需要这个:
export WAND_MAGICK_LIBRARY_SUFFIX="-7.Q16HDRI;-6.Q16HDRI"
export MAGICK_HOME=/opt/homebrew
Run Code Online (Sandbox Code Playgroud)
据推测,这使它能够找到这些:
/opt/homebrew/lib/libMagickCore-7.Q16HDRI.dylib
/opt/homebrew/lib/libMagickWand-7.Q16HDRI.dylib
/opt/homebrew/lib/libMagickCore-7.Q16HDRI.10.dylib
/opt/homebrew/lib/libMagickWand-7.Q16HDRI.10.dylib
/opt/homebrew/lib/libMagick++-7.Q16HDRI.5.dylib
/opt/homebrew/lib/libMagick++-7.Q16HDRI.dylib
Run Code Online (Sandbox Code Playgroud)