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

2024-09-29 19:20:21 发布

您现在位置:Python中文网/ 问答频道 /正文

我想使用matplotlib制作一个manelbrot集缩放动画。我使用的是Windows10,我使用的是Python3.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)

有没有办法克服这个错误


Tags: the代码importmatplotlib管理员as计算机动画

热门问题