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'
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 *
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)
EDIT: I have now also tried changing the import statement to from moviepy.editor import VideoFileClip
but with exactly the same error.
To solve the Python "AttributeError: module has no attribute", make sure you haven't named your local modules with names of remote modules, e.g. datetime.py or requests.py and remove any circular dependencies in import statements.
It's simply because there is no attribute with the name you called, for that Object. This means that you got the error when the "module" does not contain the method you are calling.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With