Ask Your Question

`sage -pip install --user ffmpeg` did not make the "`OSError: Error: ffmpeg does not appear to be installed.`" message go away

asked 2019-08-18 21:06:07 +0200

otherrealm gravatar image

updated 2019-08-20 02:09:11 +0200

I am running a Docker instance of Cocalc on a Ubuntu 16 server. Everything seems to be working but I am trying to debug why sage -pip install --user ffmpeg did not make the "OSError: Error: ffmpeg does not appear to be installed." message go away, even though it said it had been installed. Here is the full message.

Error in lines 9-9
Traceback (most recent call last):
  File "/usr/local/sage/local/lib/python2.7/site-packages/smc_sagews/", line 1188, in execute
    flags=compile_flags) in namespace, locals
  File "", line 1, in <module>
  File "/usr/local/sage/local/lib/python2.7/site-packages/smc_sagews/", line 2944, in show
    s = show0(objs, combine_all=True)
  File "/usr/local/sage/local/lib/python2.7/site-packages/smc_sagews/", line 2903, in show0
    b = show0(a)
  File "/usr/local/sage/local/lib/python2.7/site-packages/smc_sagews/", line 2868, in show0
    show_animation(obj, **kwds)
  File "/usr/local/sage/local/lib/python2.7/site-packages/smc_sagews/", line 2642, in show_animation
    obj.ffmpeg(t, delay=delay, **kwds)
  File "/usr/local/sage/local/lib/python2.7/site-packages/sage/plot/", line 885, in ffmpeg
    raise OSError(msg)
OSError: Error: ffmpeg does not appear to be installed. Saving an animation to
a movie file in any format other than GIF requires this software, so
please install it and try again.

For reference, here is the code that gives the error:

n = var("n")
frames = []
xr = (x, 0, 1)
for k in srange(1, 50):
    g = plot((sum((-1)^(n-1)*sin(n*x)/n,n,1,k)), xr, color="blue", legend_label='k = %d' % k)
    g += plot(x/2, xr, color="green", legend_label="x/2")

a = animate(frames, ymin=0.0, ymax=1.0, legend_loc=(0.2,0.8))
edit retag flag offensive close merge delete


It's not really clear what you mean by "I restarted everywhere I could restart", nor is it clear in what context you're getting this message. Did you try re-creating the Docker container? I don't think this is really a question about Sage unfortunately. Probably not related to anything you were trying to do with ffmpeg though.

Iguananaut gravatar imageIguananaut ( 2019-08-19 10:30:12 +0200 )edit

Recreating docker appears to have resolved the communications issue, but I'm still getting the OSError: Error: ffmpeg does not appear to be installed. one

otherrealm gravatar imageotherrealm ( 2019-08-20 00:22:30 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-08-20 06:58:58 +0200

tmonteil gravatar image

I do not know exactly what is the ffmpeg Python package, but the genuine ffmpeg program is written in C, so i bet that the ffmpegPython package is only an interface of the latter, see So you should install the ffmpeg from the distro by adding something like RUN apt-get apt-get install -y ffmpeg somewhere in you dockerfile.

edit flag offensive delete link more


It looks like there is a poorly(?) documented optional dependency on ffmpeg for saving plot animations as video formats. That should probably be improved somehow. It looks like there isn't even an optional sage package for it...

Iguananaut gravatar imageIguananaut ( 2019-08-21 11:24:37 +0200 )edit

Installing the apt-get version in the docker bash console seems to have worked. Thanks!!!

otherrealm gravatar imageotherrealm ( 2019-08-25 02:53:08 +0200 )edit

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


Asked: 2019-08-18 21:06:07 +0200

Seen: 1,145 times

Last updated: Aug 20 '19