简体   繁体   中英

Installing imagemagick using homebrew -- can't find command

I tried installing imagemagick using homebrew on a Mac. Specifically, I did:

brew install imagemagick

in terminal. There were no error messages. When I go to use imagemagick, eg using the command:

magick convert

I don't see the magick command available when I try to tab complete. I'm a bit uncertain how to debug this -- it seems like it should have installed fine?

As part of installing homebrew you need to set your PATH so your shell knows where the executable binaries are installed.

Depending on your homebrew version and macOS hardware and software, you may need:

export PATH=/opt/homebrew/bin:$PATH

or

export PATH=/usr/local/bin:$PATH

You can tell which of the two commands above you need with:

find {/opt/homebrew,/usr/local}/bin -name magick

Then run:

hash -r

and all homebrew commands like magick should work for your current session.


If you want the PATH set correctly for all future sessions you will need to add the export command from above to your login profile. That will depend on your shell, but is probably:

$HOME/.zprofile

or

$HOME/.profile

Note that you should read this answer to understand why you do NOT want to use magick convert .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM