关于moviepy打包报错AttributeError: module audio/video.fx.all has no attribute fadein、crop文章的纠错和抄袭
老猿前面有篇文章《moviepy应用pyinstaller打包后执行报错AttributeError: module audio/video.fx.all has no attribute ‘fadein’、crop》,今天居然发现有人原文照抄还获了很多个赞,而老猿的原文居然还没有赞。抄袭文章链接为:https://www.pythonheidong.com/blog/article/314732/。并且这篇文章今天仔细核对了一下,还有错误,在此更正一下。
原文解决办法部分,“如针对audio.fx.all,在Python中手工执行如下代码:”
import pkgutil
import moviepy.video.fx as fx
__all__ = [name for _, name, _ in pkgutil.iter_modules(fx.__path__) if name != "all"]
for name in __all__:
print("from moviepy.video.fx import %s" % (name))
实际上这个地方应该这样处理:
>>> import pkgutil
>>> import moviepy.audio.fx as fx
>>> __all__ = [name for _, name, _ in pkgutil.iter_modules(
fx.__path__) if name != "all"]
>>> for name in __all__:
print("from moviepy.audio.fx import %s" % (name))
from moviepy.audio.fx import audio_fadein
from moviepy.audio.fx import audio_fadeout
from moviepy.audio.fx import audio_left_right
from moviepy.audio.fx import audio_loop
from moviepy.audio.fx import audio_normalize
from moviepy.audio.fx import volumex
>>>
将上面的输出语句拷贝到audio.fx.all的__init__.py,替换被注释的2行代码即可。如movipy1.03的版本中,拷贝到audio.fx.all的__init__.py文件后,该文件内容为如下:
"""
Loads all the fx !
Usage:
import moviepy.audio.fx.all as afx
audio_clip = afx.volume_x(some_clip, .5)
"""
import pkgutil
import moviepy.audio.fx as fx
__all__ = [name for _, name, _ in pkgutil.iter_modules(
fx.__path__) if name != "all"]
#for name in __all__:
exec("from ..%s import %s" % (name, name))
#for name in __all__:
# print("from moviepy.audio.fx import %s" % (name))
from moviepy.audio.fx import audio_fadein
from moviepy.audio.fx import audio_fadeout
from moviepy.audio.fx import audio_left_right
from moviepy.audio.fx import audio_loop
from moviepy.audio.fx import audio_normalize
from moviepy.audio.fx import volumex
老猿的付费专栏《使用PyQt开发图形界面Python应用》专门介绍基于Python的PyQt图形界面开发基础教程,付费专栏《moviepy音视频开发专栏》详细介绍moviepy音视频剪辑合成处理的类相关方法及使用相关方法进行相关剪辑合成场景的处理,两个专栏加起来只需要19.9元,都适合有一定Python基础但无相关专利知识的小白读者学习。这2个收费专栏都有对应免费专栏,只是收费专栏的文章介绍更具体、内容更深入、案例更多。
对于缺乏Python基础的同仁,可以通过老猿的免费专栏《专栏:Python基础教程目录》从零开始学习Python。
如果有兴趣也愿意支持老猿的读者,欢迎购买付费专栏。
跟老猿学Python、学5G!
关于moviepy打包报错AttributeError: module audio/video.fx.all has no attribute fadein、crop文章的纠错和抄袭的更多相关文章
- moviepy应用pyinstaller打包后执行报错AttributeError: module audio/video.fx.all has no attribute fadein、crop
专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt入门学习 老猿Python博文目录 在开发moviepy的Python程序使用pyinstaller打包后 ...
- 使用jieba导入引用方法时,报错AttributeError: module 'jieba' has no attribute 'cut'
一.问题描述 import jieba导入后,使用jieba.cut()方法时报错AttributeError: module 'jieba' has no attribute 'cut' 二.问题分 ...
- python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法?
python中引入包的时候报错:import unittestimport smtplibimport timeimport osimport sysimp.reload(sys)sys.setdef ...
- [已解决]pycharm报错:AttributeError: module 'pip' has no attribute 'main'
> 更新pip后,pycharm更新模块报错,经过一番查找,现提供两种解决办法. 报错片段信息如下: AttributeError: module 'pip' has no attribute ...
- Centos6.5下安装jumpserver-1.4.1报错AttributeError: module 'gssapi' has no attribute 'GSSException'
报错: >>> import paramiko Traceback (most recent call last): File "<stdin>", ...
- ansible报错AttributeError: module 'urllib.request' has no attribute 'HTTPSHandler'
报错内容: TASK [activemq : extract activemq tarball] *************************************************** ...
- unittest模块在linux报错: AttributeError: module 'unittest' has no attribute 'TestRunner'
一开始在windows下运行没有问题,但是在linux下运行却报如下错误: AttributeError: module 'unittest' has no attribute 'TestRunn ...
- python文件名不要跟模块名相同,报错AttributeError: 'module' object has no attribute 'Differ'
python中的文件都会生成pyc文件,包括模块也是这样,所以调用模块的时候,实际上会调用模块.pyc文件:在这个前提下,如果将文件名命名成跟模块名一样,在同一目录下就会生成一个跟模块名一样的pyc文 ...
- 运行pytest,报错"AttributeError: 'module' object has no attribute 'xxx'"
最近学习pytest被此问题困扰,敲脑壳,实在是不该.百度解决方法一大堆,我的问题怎么也解决不了,来看一下,我是怎么解决的,各位大佬勿喷,只是自己做笔记用,谢谢. 报错信息如下: 网上解决方法是这样的 ...
随机推荐
- null列的值不参与比较
假如数据库有表emp: empno name age 001 lucy 22 002 lily null 003 lilei nu ...
- TCP/IP模型简介和/etc/hosts文件说明
软件=协议的实现. IP决定了主机的位置.端口号决定了进程的位置. 两台主机上的通讯实际是两台主机上两个具体进程的通讯. TCP/IP模型分四层: TCP/IP模型:应用层---传输层----网络层- ...
- 《.NET 5.0 背锅案》第7集-大结局:捉拿真凶 StackExchange.Redis.Extensions 归案
第1集:验证 .NET 5.0 正式版 docker 镜像问题 第2集:码中的小窟窿,背后的大坑,发现重要嫌犯 EnyimMemcachedCore 第3集-剧情反转:EnyimMemcachedCo ...
- python学习--sys.argv
sys.argv是获取命令行参数的: sys.argv[0]表示代码本身文件路径:从1开始获取参数. import sysprint (sys.argv[0])count = int(sys.argv ...
- Annotation注解初识
注解本质上就是一个接口,该接口默认继承Annotation接口 元注解 元注解的作用就是描述其他注解.Java1.5定义了4个标准的meta-annotation类型,它们被用来提供对其它 annot ...
- 使用Feign发送HTTP请求
使用Feign发送HTTP请求 在往常的 HTTP 调用中,一直都是使用的官方提供的 RestTemplate 来进行远程调用,该调用方式将组装代码冗余到正常业务代码中,不够优雅,因此在接触到 Fei ...
- phpmyadmin 4.8.1任意文件包含(CVE-2018-12613)
简介 环境复现:https://gitee.com/xiaohua1998/hctf_2018_warmup 考察知识点:文件包含漏洞(phpmyadmin 4.8.1任意文件包含) 线上平台:榆林学 ...
- Bugku-cms1
一.先用御剑扫描 二.点击第一个目录,发现sql文件 三.把它载下来,用Notepad++打开.发现管理员的账号和密码(admin的密码好像被人改了,然后我用admin888登的后台) 四.后台地址 ...
- [PHP安全特性学习]is_numeric()函数安全漏洞
简介 PHP函数的安全特性-is_numerice() 函数 简介 PHP is_numeric() 函数 is_numeric() 函数用于检测变量是否为数字或数字字符串. 语法: bool is_ ...
- mysql学习笔记1(mysql的基本架构)
mysql基本架构图 如图所示: 1 . MySQL 可以分为 Server 层和存储引擎层两部分 Server 层包括连接器.查询缓存.分析器.优化器.执行器等,涵盖 MySQL 的大多数核心服务功 ...

