'ModuleNotFoundError: No module named 'decorator' when using moviepy

I'm trying to use moviepy to edit a video with the following code. However, I ran into an error ModuleNotFoundError: No module named 'decorator'.

error message

I was wondering if anyone can help me out to get rid of this error.

Thanks!

import pandas as pd
from subprocess import run
from moviepy.editor import VideoFileClip
from moviepy.editor import *

time = pd.read_csv('replay_timecode.csv')

vidlist = []

for i in range(len(time)):
    run('ffmpeg -ss {} -i test.mp4 -to {} -c copy replay_{}.mp4'.format(time.loc[i,'start'],time.loc[i,'duration'],i))
vidlist.append(VideoFileClip('replay_{}.mp4'.format(i)))

final_clip = concatenate_videoclips(vidlist)
final_clip.to_videofile("replay_combined.mp4", fps=25, remove_temp=False)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source