From ee09b973d7c5bf4556b74b4be2ea30131fef4980 Mon Sep 17 00:00:00 2001 From: ayush0054 Date: Mon, 23 Dec 2024 18:15:15 +0530 Subject: [PATCH] added check --- phi/tools/moviepy_video_tools.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/phi/tools/moviepy_video_tools.py b/phi/tools/moviepy_video_tools.py index 8babb83ae..e09944d1f 100644 --- a/phi/tools/moviepy_video_tools.py +++ b/phi/tools/moviepy_video_tools.py @@ -1,8 +1,14 @@ from phi.tools import Toolkit -from moviepy import VideoFileClip, TextClip, CompositeVideoClip, ColorClip # type: ignore from phi.utils.log import logger from typing import List, Dict +try: + from moviepy import VideoFileClip, TextClip, CompositeVideoClip, ColorClip # type: ignore +except ImportError: + raise ImportError( + "`moviepy` not installed. Please install using `pip install moviepy`" + ) + class MoviePyVideoTools(Toolkit): """Tool for processing video files, extracting audio, transcribing and adding captions"""