WinError 5 访问被拒绝需要帮助保存 matplotlib 动画

时间:2021-01-03 22:00:34

标签: python windows matplotlib pycharm

我想使用 matplotlib 制作 manelbrot 集缩放动画。我在 Windows 10 上使用 Python 3.7 和 PyCharm。生成动画的代码效果很好,但我无法将实际动画保存在我的计算机上,因为它总是返回 [WinError 5] 访问被拒绝。我曾尝试以管理员身份运行 PyCharm,但没有奏效。代码如下所示:

import matplotlib.pyplot as plt
import numpy as np
import matplotlib.animation as animation


plt.rcParams['animation.ffmpeg_path'] = r'C:\Users\User\Desktop'

"""the code that produces the animation"""

mywriter = animation.FFMpegWriter()
animation.save('mymovie.mp4', writer=mywriter)

有什么办法可以克服这个错误吗?

0 个答案:

没有答案