Ask Your Question
1

sage don't see my imagemagik nor ffmpeg

asked 2022-05-06 09:26:39 +0100

moon gravatar image

updated 2022-05-06 09:43:11 +0100

Hi there I'm having troubles making animation since sage do not recognize ffmpeg & convert. I started considering the options that I saw in this forum.
here is the status. when I run the following in sagemath
s=animate(sf,aspect_ratio=(1,1,1))
s.save('gif/an.gif')

OSError: Error: Neither ImageMagick nor ffmpeg appear to be installed.

Current situation

  1. I have ffmpeg installed (I'm using it with audacity)
  2. I have imagemagik installed and running very nicely since many years
  3. I have the binaries (convert, ffmpeg, ffprobe in the /usr/local/bin folder
  4. I have the PATH variable containing /usr/local/bin
  5. have_program('convert') returns False
  6. have_program('convert',path=`"/usr/local/bin"`) returns True
  7. init.sage created and contains the following PATH=$PATH:/usr/local/bin`
  8. echo $PATH returns "/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin "

one can see that /usr/local/bin appears twice.

Configuration

Running MacOs Montery version 12.1, sage 9-5 as an app.

Hope someone out there having some idea. All the best

edit retag flag offensive close merge delete

Comments

Running MacOs Montery version 12.1, sage 9-5 as an app.

Mac OS is known to pull such shenanigans. Perusing sage-support, and possibly asking there, might be useful.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2022-05-06 13:25:44 +0100 )edit
2

On a mac, the line PATH=$PATH:/usr/local/bin should be added to the .bash_profile file I think not in the init.sage file

Sébastien gravatar imageSébastien ( 2022-05-06 14:03:41 +0100 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2022-05-09 06:26:23 +0100

Please try this in Sage:

sage: from sage.features.imagemagick import ImageMagick
sage: ImageMagick().is_present()

If the convert program is present and functional, it should return FeatureTestResult('imagemagick', True). Otherwise, maybe it will return a helpful error message. You could try the same with

sage: from sage.features.ffmpeg import FFmpeg
sage: FFmpeg().is_present()

It also would be good, within Sage, to evaluate os.getenv('PATH') to see what Sage thinks PATH is. I agree with @Sébastien that you shouldn't set PATH in init.sage.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-05-06 09:26:39 +0100

Seen: 250 times

Last updated: May 09 '22