Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
562 views
in Technique[技术] by (71.8m points)

windows - PermissionError: [WinError 5] Access is denied python using moviepy to write gif

I'm using windows 8.1 64 bit

my code

import pdb
from moviepy.editor import *

clip = VideoFileClip(".\a.mp4")
clip.write_gif('.\aasda.gif')

the exception is at write_gif method

Traceback (most recent call last):
  File "C:abiyoutubetogif_projectest.py", line 5, in <module>
    clip.write_gif('G:\abi\aasda.gif')
  File "<string>", line 2, in write_gif
  File "C:Python34libsite-packagesmoviepy-0.2.1.8.12-py3.4.eggmoviepydecorators.py", line 49, in requires_duration
    return f(clip, *a, **k)
  File "C:Python34libsite-packagesmoviepy-0.2.1.8.12-py3.4.eggmoviepyvideoVideoClip.py", line 435, in write_gif
    dispose= dispose, colors=colors)
  File "<string>", line 2, in write_gif
  File "C:Python34libsite-packagesmoviepy-0.2.1.8.12-py3.4.eggmoviepydecorators.py", line 49, in requires_duration
    return f(clip, *a, **k)
  File "C:Python34libsite-packagesmoviepy-0.2.1.8.12-py3.4.eggmoviepyvideoiogif_writers.py", line 186, in write_gif
    stdout=sp.PIPE)
  File "C:Python34libsubprocess.py", line 848, in __init__
    restore_signals, start_new_session)
  File "C:Python34libsubprocess.py", line 1104, in _execute_child
    startupinfo)
PermissionError: [WinError 5] Access is denied

I moved the script to another folder and partition, running moviepy dependancies and python as admin, turning off UAC still gives me error

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I've run into this as well, solution is usually to be sure to run the program as an administrator (right click, run as administrator.)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...