一、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:\ImageMagick-7.0.8-Q16\magick.exe" # 这是要添加ImageMagic的安装路径