Sage does not see Imagemagick

asked 2018-09-11 19:18:14 -0500

Symbol 1 gravatar image

updated 2018-09-13 09:10:35 -0500

tmonteil gravatar image

I am trying out the animation thing in http://doc.sagemath.org/html/en/refer....

But Sage keep saying

Error: Neither ImageMagick nor ffmpeg appears to be installed.

And indeed

from sage.misc.sage_ostools import have_program
have_program('convert')

returns false.

But I do have ImageMagick installed by homwbrew. i.e. it works perfectly in Terminal.

What Could Possibly Go Wrong?

(macOS 10.13; Sage 8.3; Imagemagick 7.0.8.)

edit retag flag offensive close merge delete

Comments

Update: have_program('convert',path="/usr/local/bin") returns true.

Symbol 1 gravatar imageSymbol 1 ( 2018-09-11 19:27:11 -0500 )edit

I temporarily solve this by os.environ["PATH"]+=":/usr/local/bin". Looking for a permanent solution.

Symbol 1 gravatar imageSymbol 1 ( 2018-09-11 19:49:38 -0500 )edit

Well, sounds to me like your ImageMagick is installed under the /usr/local prefix so you should add that permanently to your PATH (such as in .profile or something). On Most Linuxes /usr/local/bin will be on your PATH by default, but I don't know about macOS.

Iguananaut gravatar imageIguananaut ( 2018-09-12 04:30:13 -0500 )edit

@Iguananaut I feel like there are two PATHs. The PATH in my terminal does contains /usr/local/bin/ as I can see it if I do echo $PATH. But then the python coming with sage assumes a different PATH, which does not contain /usr/local/, as shown by os.environ["PATH"]. I am not sure which .profile should I fix in this case.

Symbol 1 gravatar imageSymbol 1 ( 2018-09-15 15:36:56 -0500 )edit