Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

python

windows

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:\abi\youtubetogif_project\test.py", line 5, in <module>     clip.write_gif('G:\\abi\\aasda.gif')   File "<string>", line 2, in write_gif   File "C:\Python34\lib\site-packages\moviepy-0.2.1.8.12-py3.4.egg\moviepy\decorators.py", line 49, in requires_duration     return f(clip, *a, **k)   File "C:\Python34\lib\site-packages\moviepy-0.2.1.8.12-py3.4.egg\moviepy\video\VideoClip.py", line 435, in write_gif     dispose= dispose, colors=colors)   File "<string>", line 2, in write_gif   File "C:\Python34\lib\site-packages\moviepy-0.2.1.8.12-py3.4.egg\moviepy\decorators.py", line 49, in requires_duration     return f(clip, *a, **k)   File "C:\Python34\lib\site-packages\moviepy-0.2.1.8.12-py3.4.egg\moviepy\video\io\gif_writers.py", line 186, in write_gif     stdout=sp.PIPE)   File "C:\Python34\lib\subprocess.py", line 848, in __init__     restore_signals, start_new_session)   File "C:\Python34\lib\subprocess.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

like image 723
Abirafdi Raditya Putra Avatar asked Sep 29 '14 01:09

Abirafdi Raditya Putra


2 Answers

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.)

like image 97
Reed Jones Avatar answered Sep 23 '22 01:09

Reed Jones


Sometimes it occurs when some installations are not completed correctly, the process is stuck, or a file is still opened. So, when you try to run the installation again and the installation requires deleting, you can see the aforementioned error. In my case, shutting down the python processes and command prompt utilization helped.

like image 43
OuuLin Avatar answered Sep 24 '22 01:09

OuuLin