参考了以下两篇博文:
https://blog.csdn.net/weixin_39278265/article/details/84147458
https://blog.csdn.net/mys_mys/article/details/99646476
具体解决:
第一步:从下面链接下载来ffmpeg,然后解压
http://ffmpeg.zeranoe.com/builds/
http://www.wikihow.com/Install-FFmpeg-on-Windows
第二步:
解压后,为了下次使用方便,把文件放在Anaconda3\Lib\site-packages里面。
然后在使用animation前加上一行
plt.rcParams['animation.ffmpeg_path']=r'E:\Users\Anaconda3\Lib\sitepackages\\ffmpeg\\bin\\ffmpeg.exe' # 加上这一行
ani = animation.FuncAnimation(fig, update, frames=100, interval=200, blit=True, repeat=False)
HTML(ani.to_html5_video())