moviepy 安装之ImageMagick安装

一、moviepy安装步骤

1、pip install moviepy

2、pip install requests

此时运行moviepy视频剪辑代码,会遇到以下错误:

.This error can be due to the fact that ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary in file conf.py, or that the path you specified is incorrect。

这是因为ImageMagick没有安装

3、安装ImageMagick软件:

      (1)、下载对应版本的软件:https://www.imagemagick.org/script/index.php

      (2)、安装好,修改moviepy包(\Lib\site-packages\moviepy\)中的config_defaults.py文件,修改之后如下:

import os


FFMPEG_BINARY = os.getenv('FFMPEG_BINARY', 'ffmpeg-imageio')
# IMAGEMAGICK_BINARY = os.getenv('IMAGEMAGICK_BINARY', 'auto-detect')  # 这是注释掉原来的
IMAGEMAGICK_BINARY = r"D:\Program Files\ImageMagick-7.0.8-Q16\magick.exe"  # 这是要添加ImageMagic的安装路径

参考一下资料:

   1、moviepy官网:https://zulko.github.io/moviepy/install.html

   2、优秀博客: MoviePy 安装 配置

猜你喜欢

转载自blog.csdn.net/qq_23944915/article/details/86514301