'Installation of imagemagick with Homebew not found by python

I am trying to use wand on python on my Mac Monterrey. When I run the command on python from wand.image import Image as Img I get the error ImportError: MagickWand shared library not found. You probably had not installed ImageMagick library.

This is what I had done, following diverse guidelines. Any suggestions as to how to make wand find imagemagick?

I installed imagemagick via homebrew. I can confirm that I have that the following items exist in my computer: /opt/homebrew/Cellar/imagemagick and /opt/homebrew/Cellar/imagemagick@6.

I also did a brew unlink imagemagick && brew link imagemagick

I added the following line to the end of my .zshrc: export MAGICK_HOME="/opt/homebrew/Cellar/imagemagick"

I installed Wand via pip install in my local environment



Solution 1:[1]

That was the wrong path to put in the .zshrc. The correct path was export MAGICK_HOME="/opt/homebrew

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Doon_Bogan