Moviepy: when i run exe using moviepy module ? AttributeError: module 'moviepy.audio.fx.all' has no attribute 'audio_fadein'?

Created on 9 Aug 2019  ·  8Comments  ·  Source: Zulko/moviepy

How to solve this Error? 'moviepy.audio.fx.all' has no attribute 'audio_fadein'?

when i run exe using moviepy module ? AttributeError: module 'moviepy.audio.fx.all' has no attribute 'audio_fadein'?

environment question

Most helpful comment

For those who only use VideoClip, as is in the most basic tutorials,
from moviepy.video.VideoClip import VideoClip
also works and then you can import the fx method you need and add it to VideoClip as:
from moviepy.video.fx.resize import resize
VideoClip.resize = resize

All 8 comments

I'm getting the same error. I'm trying to bundle all the code needed to run my script with pyinstaller. However when I run the generated script I get:
from moviepy.editor import ImageClip, VideoFileClip, CompositeVideoClip File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 627, in exec_module exec(bytecode, module.__dict__) File "site-packages/moviepy/editor.py", line 84, in <module> File "<string>", line 1, in <module> AttributeError: module 'moviepy.audio.fx.all' has no attribute 'audio_fadein'

I'm not sure whether I need to create a custom recipe for moviepy or whether there are some changes required to the moviepy module to make it compatible with tools like pyinstaller or py2app. Has anyone successfully used either?

There may be a workaround consisting in never using moviepy.editor (which is meant for manual use of moviepy, and has many side-effects), and instead fetching everything you need directly from the submodules:

from moviepy.video.io.VideoFileClip import VideoFileClip
from moviepy.video.VideoClip import ImageClip
from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip

Thanks, that's worked!

Thanks, that's worked!

How you solve your problem?

Nyanyan,

Thank you, Finally I solve the problem with your kindly help.


发件人: Nyanyan notifications@github.com
发送时间: Tuesday, October 1, 2019 11:31:47 PM
收件人: Zulko/moviepy moviepy@noreply.github.com
抄送: mr-datian mr_datian@outlook.com; Comment comment@noreply.github.com
主题: Re: [Zulko/moviepy] when i run exe using moviepy module ? AttributeError: module 'moviepy.audio.fx.all' has no attribute 'audio_fadein'? (#994)

I have same problem and fixed it with write
from moviepy.video.io.VideoFileClip import VideoFileClip from moviepy.video.VideoClip import ImageClip from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
instead of
import moviepy.editor as mp


You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FZulko%2Fmoviepy%2Fissues%2F994%3Femail_source%3Dnotifications%26email_token%3DAKEQUBN7IV4S77J3QAEN4TLQMNUOHA5CNFSM4IKSIVYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEABWFWY%23issuecomment-537092827&data=02%7C01%7C%7Ca84206f10e824f15270208d74684795a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637055407095532360&sdata=EcYPs97tSDsqVmCETulTNrkuSFDipMlYbvTWj2%2Bub1A%3D&reserved=0, or mute the threadhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKEQUBPZXOTSM237AGCNFS3QMNUOHANCNFSM4IKSIVYA&data=02%7C01%7C%7Ca84206f10e824f15270208d74684795a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637055407095542298&sdata=DC%2BU8jSLd9VwBOz0nUdeYtrCc6H%2F2%2FVINCQLobpU1WY%3D&reserved=0.

For those who only use VideoClip, as is in the most basic tutorials,
from moviepy.video.VideoClip import VideoClip
also works and then you can import the fx method you need and add it to VideoClip as:
from moviepy.video.fx.resize import resize
VideoClip.resize = resize

Thank you @tanisc
I used VideoFileClip like you to load a video in a certain size:

from moviepy.video.io.VideoFileClip import VideoFileClip
from moviepy.video.fx.resize import resize
VideoFileClip.resize = resize
clip = VideoFileClip(path).resize((255,255))

For future reference: in v2.0.0.dev2 and before you only get the methods like resize when importing from moviepy.editor. In versions after this, you always get them, so workarounds described above are redundant (and you almost only ever need to import stuff from moviepy, not submodules of it).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Netherdrake picture Netherdrake  ·  5Comments

bobozar picture bobozar  ·  4Comments

cquintini picture cquintini  ·  4Comments

bilel picture bilel  ·  4Comments

TowelDude picture TowelDude  ·  3Comments