首先:pip install moviepy -i https://pypi.tuna.tsinghua.edu.cn/simple
然后:新建my4tomy3.py
from moviepy.editor import * # 要转换的mp4文件 video = VideoFileClip('/home/cjh/videos/music01.mp4') audio = video.audio # 转换为mp3文件 audio.write_audiofile('/home/cjh/videos/music01.mp3')