Last modified: Apr 07, 2025 By Alexander Williams

How to Install MoviePy in Python Step by Step

MoviePy is a powerful Python library for video editing. It allows you to cut, merge, and add effects to videos easily.

This guide will walk you through installing MoviePy step by step. Follow these instructions to get started.

Prerequisites

Before installing MoviePy, ensure you have Python installed. You can check this by running:

 
python --version


Python 3.8.5

If you don't have Python installed, download it from the official website first.

Install MoviePy Using pip

The easiest way to install MoviePy is using pip, Python's package manager. Open your terminal or command prompt.

Run the following command:

 
pip install moviepy

This will download and install MoviePy along with its dependencies.

Verify the Installation

After installation, verify MoviePy is installed correctly. Open a Python shell and type:

 
import moviepy
print(moviepy.__version__)


1.0.3

If you see a version number, MoviePy is installed successfully.

Install FFmpeg (Required for MoviePy)

MoviePy relies on FFmpeg for video processing. Install FFmpeg before using MoviePy.

On Windows, download FFmpeg from its official site. Add it to your system PATH.

On macOS, use Homebrew:

 
brew install ffmpeg

On Linux, use your package manager:

 
sudo apt-get install ffmpeg

Common Installation Issues

If you encounter errors, check these common issues.

ModuleNotFoundError: If you see this error, check our guide on how to solve ModuleNotFoundError.

FFmpeg not found: Ensure FFmpeg is installed and added to your PATH.

Basic MoviePy Example

Here's a simple example to test MoviePy. Create a Python script with this code:

 
from moviepy.editor import VideoFileClip

# Load a video file
clip = VideoFileClip("example.mp4")

# Trim the video
trimmed_clip = clip.subclip(10, 20)

# Save the trimmed video
trimmed_clip.write_videofile("trimmed_example.mp4")

This script trims a video from 10 to 20 seconds and saves it.

Conclusion

Installing MoviePy is straightforward with pip. Ensure FFmpeg is installed for full functionality.

Now you can start editing videos in Python. Explore MoviePy's documentation for more advanced features.