我安装ffmpeg和matplotlib似乎有问题:
In [9]: matplotlib.animation.writers["ffmpeg"]
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
........
58 def __getitem__(self, name):
59 if not self.avail:
---> 60 raise RuntimeError("No MovieWriters available!")
61 return self.avail[name]
62
RuntimeError: No MovieWriters available!
看来还没有找到ffmpeg (或其他任何作家)。但是,我已经从源代码构建了它,并在~/.local
中安装了它。这包括在$PATH
中,并且我验证了命令ffmpeg
是从终端运行的。
,在安装ffmpeg时,有什么需要我注意的吗?,还有其他的事情要做吗?
配置:
注意:我想避免从头开始重新安装所有的东西。我没有根访问权限,唯一手动安装的是ffmpeg。
发布于 2016-12-08 14:10:31
作者通过isAvailable
类方法检验了有效性,这种方法或多或少只是检查popen
作品.它检查的路径是来自bin_path
类方法的返回值,默认情况下,该方法寻找一个类级属性(由子类提供)来指定要查看路径的rcParams (间接的级别是值得的)。
对于ffmpeg,这是mpl.rcParams['animation.ffmpeg_path']
。
In [33]: import matplotlib.animation as ma
In [34]: ma.FFMpegWriter.bin_path()
Out[38]:
'ffmpeg'
In [39]: ma.FFMpegWriter.exec_key
Out[41]:
'animation.ffmpeg_path'
In [42]: ma.FFMpegWriter.isAvailable()
Out[44]:
True
In [45]: import matplotlib as mpl
In [46]: mpl.rcParams['animation.ffmpeg_path']
Out[46]:
'ffmpeg'
In [47]: mpl.rcParams['animation.ffmpeg_path'] = 'jibberish'
In [48]: ma.FFMpegWriter.isAvailable()
Out[48]:
False
In [49]: mpl.rcParams['animation.ffmpeg_path'] = 'ffmpeg'
In [50]: ma.FFMpegWriter.isAvailable()
Out[50]:
True
https://stackoverflow.com/questions/41041138
复制相似问题