如何在Mac OS X上使用或安装MagickWand?

Sła*_*bik 5 python macos imagemagick

我在magickwand和python和Mac OX X上遇到问题。

导入时出现错误:

ImportError: MagickWand shared library not found. You probably had not
installed ImageMagick library. Try to install:   brew install imagemagick
Run Code Online (Sandbox Code Playgroud)

brew install imagemagick Warning: imagemagick-6.8.9-1 already installed
Run Code Online (Sandbox Code Playgroud)

Rib*_*ena 11

要让 Wand 与 imagemagick 7 配合使用:

brew install imagemagick
echo 'export MAGICK_HOME=/opt/homebrew/opt/imagemagick/' >> ~/.zshrc
echo 'export PATH="/opt/homebrew/opt/imagemagick/bin:$PATH"' >> ~/.zshrc
Run Code Online (Sandbox Code Playgroud)

  • 对于 Apple Silicon (Apple M1) 用户,这是因为 homebrew 目录不同 (3认同)

Gow*_*amy 8

brew uninstall --force imagemagick

brew install imagemagick@6

echo 'export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"' >> ~/.bash_profile

brew link imagemagick@6 --force
Run Code Online (Sandbox Code Playgroud)


jrj*_*rjc 4

所以,实际的问题是:

\n\n
\n

如果您的 Python 不是使用 MacPorts 安装的,您还必须导出 MAGICK_HOME 路径。因为不是使用 MacPorts 安装的 Python 不会\xe2\x80\x99 查找 MacPorts 包的默认路径前缀 /opt/local。

\n
\n\n

来自魔杖医生

\n\n

他们提供的解决方案是:

\n\n
\n

$ 导出 MAGICK_HOME=/opt/local

\n
\n