Installing ImageMagick for a Python project

Hello, I'm trying to deploy a Python Flask image generation server, which requires ImageMagick for the Wand package. I've tried various methods to install ImageMagick but it's not been working. Even though the build logs say that ImageMagick was installed, during deployment Python produces this error:
File "/opt/venv/lib/python3.8/site-packages/wand/", line 178, in <module>
raise ImportError('MagickWand shared library not found.\n'
ImportError: MagickWand shared library not found.
You probably had not installed ImageMagick library.
Try to install:

I've tried following the steps in the link, but it still doesn't work
Before adding the Nixpacks.toml file, I had this project deployed on Heroku with no issues
Like during the free tier period
UUUnknown User4/22/2023
Message Not Public
Sign In & Join Server To View
Ah I don't really get what you mean