AttributeError:“模块”对象没有属性“ audio_fadein” [英] AttributeError: 'module' object has no attribute 'audio_fadein'
问题描述
我已经使用cx_freeze将python项目构建到具有.exe及其依赖项的单个文件夹中,但是当我运行.exe时出现错误:
I have used cx_freeze to build a python project into a single folder with an .exe and it's dependencies, but when I run the .exe I get the error:
AttributeError: module 'moviepy.audio.fx.all' has no attribute 'audio_fadein'
我已经阅读了MoviePy的文档,但无法找到原因。我的Python程序可在IDE(PyCharm)内完美运行,但编译后出现MoviePy错误。我已经使用了来自moviepy.editor导入的推荐 *
I have read the docs for MoviePy but cannot find out why this is happening. My Python program runs perfectly from within the IDE (PyCharm) but after compiling, I am getting the MoviePy error. I have used the recommended from moviepy.editor import *
我实际上没有使用 audio_fadein
直接在脚本中显示,因此在显示视频时,MoviePy必须调用它。以下是代码:
I don't actually use the audio_fadein
directly in my script, so it must be being called by MoviePy when I show my video. Here is the code:
def cherrybyte():
pygame.display.set_caption('©2017 CherryByte™ Software')
pygame.mouse.set_visible(False)
logo = VideoFileClip('CherryByte Logo.mp4')
logo.preview()
pygame.mouse.set_visible(True)
编辑:我现在也尝试将import语句从moviepy更改为。编辑器导入VideoFileClip
,但有完全相同的错误。
I have now also tried changing the import statement to from moviepy.editor import VideoFileClip
but with exactly the same error.
推荐答案
我在使用时遇到了相同的错误pyinstaller来生成.exe文件。
但是,我将import语句从moviepy.video.io.VideoFileClip更改为 import VideoFileClip
并成功了。
I had same error while I was using the pyinstaller to build the .exe file.
However, I changed the import statement to from moviepy.video.io.VideoFileClip import VideoFileClip
and it worked.
这篇关于AttributeError:“模块”对象没有属性“ audio_fadein”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!