-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: module 'moviepy.audio.fx.all' has no attribute 'audio_fadein' #591
Comments
For everyone that has the same issue i solved it by modifying the selected init file shown in the picture below: Inside it there is a piece of code that import every function inside the fx folder:
Comment this block and import manually every function needed, like so:
Do the same with the init placed in moviepy.audio.fx.all |
I can vouch for ZiddyEng's answer, it worked perfectly for me. |
I have followed the Instructions that you provide,but it still with the same issue.So,could you please provide more detailed operation instructions. |
I am having the same issue :( but with pyinstaller The recommendation kinda fix the issue, but I have another error now with 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
and this is the full list of video:
|
@ZiddyEng 's solution works like a charm, no issues, but it is still a hack, not the proper solution, we should fix editor PyCharm(VSCode in my case). |
Frankly this package list does not get updated quite often. It would be a whole less messier to import files by name rather than using exec, and also it would make packaging apps that rely on moviepy a lot easier. |
I also use pyinstaller to freeze and it is pretty inconvenient to edit the library rather than my own code. What is worked for me is to import only what I am gonna use manually in my own code e.g.;
|
The way of import the FXs described in this issue is deprecated, so I'm closing this... |
Well the @ZiddyEng 's solution worked but I got new error, I am using pyinstaller File "", line 991, in _find_and_load But I found the solution: step 1:
from moviepy.video.fx.accel_decel import accel_decel step 2:
from moviepy.audio.fx.audio_fadein import audio_fadein now if you build exe with pyinstaller it fixes the error not sure if it works with cx_freeze. |
still got same issue pyinstaller |
@wanghaisheng Follow the steps above your comments. don't edit in the virtual enviroment. |
@saifullah9002 can you just push these code to master branch and got merged? |
@saifullah9002 there is no all_init_.py in moviepy 1.0.3 version Python 3\Lib\site-packages\moviepy\video\fx\all_init_.py |
@wanghaisheng Please open a new issue describing the problem you are having instead of commenting on an old, closed one that might or might not be related, thank you. |
@keikoro I am curious why this same issue still exist |
@wanghaisheng The original issue didn't even mention pyinstaller, other people just added onto it. Also, you can always refer to an older, (possibly) related issue by mentioning its ticket no. in your own issue. This will create a link between the two for easy navigation. |
I had the same situation. I got this error. Traceback (most recent call last): I was wondering how to fix this? And anyone has any idea? |
You can obviously comment on closed issues, I was mainly making you aware that commenting here won't get you as much attention because fewer people will see it (I only did because I'm a maintainer, who gets notifications). Of the people who do, not everyone will bother to read through all the old content to try to figure how the new comments relate, because old, closed issues naturally tend to get new comments that don't have anything to do with the original post. As said by a fellow maintainer up-thread, some of the info given by OP in 2017 isn't applicable anymore to how things are handled in recent versions of the library, that's why the issue was closed. If you continue to comment here, your issue either doesn't match OP's issue (with outdated code) exactly, in which case you ought to open a new one; or, you are using outdated versions of MoviePy, in which case you should upgrade. |
Big high five. It works. What I did was, I copy pasted anhhna's comment. Then I covert it to an exe using AUTOPYTOEXE module. You can easily download this by pip though. This is my imports looks like now. from moviepy.video.io.VideoFileClip import VideoFileClip from moviepy.audio.fx.audio_fadein import audio_fadein |
@Vikasitha444 where do you put my imports to which file |
Still an issue with https://github.com/Zulko/moviepy/releases/tag/v2.0.0.dev2 |
@Vikasitha444 's solution solved my problem while using PyInstaller to compile executables. |
For me worked this: Also here comment all the content of: Now you will get your .exe without problems but in my case after concatenate several videos there was a wrong encoding and I got I bad video, only some videos I could watch fine but another were difuse. |
still same error |
I am also facing this issue: root@2eee84d9d145:/app# python3 -m pip install moviepy==1.0.3
Collecting moviepy==1.0.3
Using cached moviepy-1.0.3-py3-none-any.whl
Requirement already satisfied: decorator<5.0,>=4.0.2 in /usr/local/lib/python3.8/dist-packages (from moviepy==1.0.3) (4.4.2)
Requirement already satisfied: proglog<=1.0.0 in /usr/local/lib/python3.8/dist-packages (from moviepy==1.0.3) (0.1.10)
Requirement already satisfied: requests<3.0,>=2.8.1 in /usr/local/lib/python3.8/dist-packages (from moviepy==1.0.3) (2.28.2)
Requirement already satisfied: tqdm<5.0,>=4.11.2 in /usr/local/lib/python3.8/dist-packages (from moviepy==1.0.3) (4.65.0)
Requirement already satisfied: numpy>=1.17.3 in /usr/local/lib/python3.8/dist-packages (from moviepy==1.0.3) (1.23.5)
Requirement already satisfied: imageio<3.0,>=2.5 in /usr/local/lib/python3.8/dist-packages (from moviepy==1.0.3) (2.27.0)
Requirement already satisfied: imageio-ffmpeg>=0.2.0 in /usr/local/lib/python3.8/dist-packages (from moviepy==1.0.3) (0.4.8)
Requirement already satisfied: pillow>=8.3.2 in /usr/local/lib/python3.8/dist-packages (from imageio<3.0,>=2.5->moviepy==1.0.3) (9.5.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.8/dist-packages (from requests<3.0,>=2.8.1->moviepy==1.0.3) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.8/dist-packages (from requests<3.0,>=2.8.1->moviepy==1.0.3) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.8/dist-packages (from requests<3.0,>=2.8.1->moviepy==1.0.3) (1.26.15)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.8/dist-packages (from requests<3.0,>=2.8.1->moviepy==1.0.3) (2022.12.7)
Installing collected packages: moviepy
Successfully installed moviepy-1.0.3
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@2eee84d9d145:/app# python3 -c "from moviepy.audio.fx.multiply_volume import multiply_volume"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'moviepy.audio.fx.multiply_volume'
root@2eee84d9d145:/app# python3 -m pip uninstall moviepy
Found existing installation: moviepy 1.0.3
Uninstalling moviepy-1.0.3:
Would remove:
/usr/local/lib/python3.8/dist-packages/moviepy-1.0.3.dist-info/*
/usr/local/lib/python3.8/dist-packages/moviepy/*
Proceed (Y/n)? y
Successfully uninstalled moviepy-1.0.3
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@2eee84d9d145:/app# python3 -m pip install moviepy==1.0.3
Collecting moviepy==1.0.3
Using cached moviepy-1.0.3-py3-none-any.whl
Requirement already satisfied: decorator<5.0,>=4.0.2 in /usr/local/lib/python3.8/dist-packages (from moviepy==1.0.3) (4.4.2)
Requirement already satisfied: proglog<=1.0.0 in /usr/local/lib/python3.8/dist-packages (from moviepy==1.0.3) (0.1.10)
Requirement already satisfied: requests<3.0,>=2.8.1 in /usr/local/lib/python3.8/dist-packages (from moviepy==1.0.3) (2.28.2)
Requirement already satisfied: tqdm<5.0,>=4.11.2 in /usr/local/lib/python3.8/dist-packages (from moviepy==1.0.3) (4.65.0)
Requirement already satisfied: numpy>=1.17.3 in /usr/local/lib/python3.8/dist-packages (from moviepy==1.0.3) (1.23.5)
Requirement already satisfied: imageio<3.0,>=2.5 in /usr/local/lib/python3.8/dist-packages (from moviepy==1.0.3) (2.27.0)
Requirement already satisfied: imageio-ffmpeg>=0.2.0 in /usr/local/lib/python3.8/dist-packages (from moviepy==1.0.3) (0.4.8)
Requirement already satisfied: pillow>=8.3.2 in /usr/local/lib/python3.8/dist-packages (from imageio<3.0,>=2.5->moviepy==1.0.3) (9.5.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.8/dist-packages (from requests<3.0,>=2.8.1->moviepy==1.0.3) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.8/dist-packages (from requests<3.0,>=2.8.1->moviepy==1.0.3) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.8/dist-packages (from requests<3.0,>=2.8.1->moviepy==1.0.3) (1.26.15)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.8/dist-packages (from requests<3.0,>=2.8.1->moviepy==1.0.3) (2022.12.7)
Installing collected packages: moviepy
Successfully installed moviepy-1.0.3
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@2eee84d9d145:/app# python3 -c "from moviepy.audio.fx.multiply_volume import multiply_volume"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'moviepy.audio.fx.multiply_volume' |
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 alsofrom moviepy.video.io.VideoFileClip import VideoFileClip
and here is the python code: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](https://user-images.githubusercontent.com/22495680/27264490-b54d0dd6-5477-11e7-9653-eaa51843bb5a.png)
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)
The text was updated successfully, but these errors were encountered: