AttributeError: module 'moviepy.audio.fx.all' has no attribute 'audio_fadein'

See original GitHub issue

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 tried both from moviepy.editor import * and also from moviepy.video.io.VideoFileClip import VideoFileClip and here is the python code:

    pygame.display.set_mode((854, 480), pygame.NOFRAME)
    pygame.display.set_caption('©2017 CherryByte™ Software')
    pygame.mouse.set_visible(False)
    logo = VideoFileClip('CherryByte Logo.mp4')
    logo.preview()
    pygame.mouse.set_visible(True)

It seems to run fine from the IDE (PyCharm) but once built, it seems to fail. Here is a shot of the Traceback: 2017-06-18 3

Python version 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] Version info. sys.version_info(major=3, minor=6, micro=1, releaselevel=‘final’, serial=0)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:24 (1 by maintainers)

github_iconTop GitHub Comments

22reactions
ZiddyEngcommented, Sep 5, 2018

For everyone that has the same issue i solved it by modifying the selected init file shown in the picture below:

File Location

Inside it there is a piece of code that import every function inside the fx folder:

__all__ = [name for _, name, _ in pkgutil.iter_modules(
    fx.__path__) if name != "all"]
for name in __all__:
    exec("from ..%s import %s" % (name, name))

Comment this block and import manually every function needed, like so:

from moviepy.video.fx.accel_decel import accel_decel
from moviepy.video.fx.blackwhite import blackwhite
from moviepy.video.fx.blink import blink
from moviepy.video.fx.crop import crop
from moviepy.video.fx.even_size import even_size
from moviepy.video.fx.fadein import fadein
from moviepy.video.fx.fadeout import fadeout
from moviepy.video.fx.mirror_x import mirror_x
from moviepy.video.fx.mirror_y import mirror_y
from moviepy.video.fx.resize import resize
#etc.

Do the same with the init placed in moviepy.audio.fx.all

18reactions
anhhnacommented, Nov 30, 2018

I am having the same issue 😦 but with pyinstaller

The recommendation kinda fix the issue, but I have another error now with volumex attribute not found.

Anyone knows a way to replace the original code with something less static that the whole import list?

you can do with the ZiddyEng comment but with audio

from moviepy.audio.fx.audio_fadein import audio_fadein
from moviepy.audio.fx.audio_fadeout import audio_fadeout
from moviepy.audio.fx.audio_left_right import audio_left_right
from moviepy.audio.fx.audio_loop import audio_loop
from moviepy.audio.fx.audio_normalize import audio_normalize
from moviepy.audio.fx.volumex import volumex

and this is the full list of video:

from moviepy.video.fx.accel_decel import accel_decel
from moviepy.video.fx.blackwhite import blackwhite
from moviepy.video.fx.blink import blink
from moviepy.video.fx.colorx import colorx
from moviepy.video.fx.crop import crop
from moviepy.video.fx.even_size import even_size
from moviepy.video.fx.fadein import fadein
from moviepy.video.fx.fadeout import fadeout
from moviepy.video.fx.freeze import freeze
from moviepy.video.fx.freeze_region import freeze_region
from moviepy.video.fx.gamma_corr import gamma_corr
from moviepy.video.fx.headblur import headblur
from moviepy.video.fx.invert_colors import invert_colors
from moviepy.video.fx.loop import loop
from moviepy.video.fx.lum_contrast import lum_contrast
from moviepy.video.fx.make_loopable import make_loopable
from moviepy.video.fx.margin import margin
from moviepy.video.fx.mask_and import mask_and
from moviepy.video.fx.mask_color import mask_color
from moviepy.video.fx.mask_or import mask_or
from moviepy.video.fx.mirror_x import mirror_x
from moviepy.video.fx.mirror_y import mirror_y
from moviepy.video.fx.painting import painting
from moviepy.video.fx.resize import resize
from moviepy.video.fx.rotate import rotate
from moviepy.video.fx.scroll import scroll
from moviepy.video.fx.speedx import speedx
from moviepy.video.fx.supersample import supersample
from moviepy.video.fx.time_mirror import time_mirror
from moviepy.video.fx.time_symmetrize import time_symmetrize
Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'module' object has no attribute 'audio_fadein'
I had same error while I was using the pyinstaller to build the .exe file. However, I changed the import statement to from...
Read more >
Attributeerror: 'Module' Object Has No Attribute ... - ADocLib
AttributeError : module 'moviepy.audio.fx.all' has no attribute 'audiofadein'. Just when I was So I used pyinstaller to package in the pycharm terminal.
Read more >
audio.fx — MoviePy 1.0.2 documentation
The module moviepy.audio.fx regroups functions meant to be used with audio.fx() . ... import moviepy.audio.fx.all as afx newaudio = (audioclip.afx( ...
Read more >
module 'moviepy.audio.fx.all' has no attribute 'audio_fadein'_ ...
Pyinstaller:moviepy打包报错AttributeError: module 'moviepy.audio.fx.all' has no attribute 'audio_fadein'. 丶凉 于 2021-09-05 23:29:56 发布 8571 收藏 20.
Read more >
AttributeError: 'module' object has no attribute 'audio_fadein'
AttributeError : module 'moviepy.audio.fx.all' has no attribute 'audio_fadein'. AttributeError. I have read the docs for MoviePy but cannot ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found