python - moviepy subclip 函数中的名称错误

标签 python package nameerror moviepy

Traceback (most recent call last):
  File "C:\Users\Evan\Desktop\Gamble\main.py", line 159, in <module>
    main()
  File "C:\Users\Evan\Desktop\Gamble\main.py", line 128, in main
    link = create_clip(count, "WITHDRAW", root)
  File "C:\Users\Evan\Desktop\Gamble\main.py", line 53, in create_clip
    new = video.subclip(int(frame / 60 - 5), int(frame / 60 + 5))
  File "C:\Users\Evan\anaconda3\envs\F\lib\site-packages\decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
  File "C:\Users\Evan\anaconda3\envs\F\lib\site-packages\moviepy\decorators.py", line 79, in wrapper
    names = inspect.getfullargspec(func).args
NameError: name 'func' is not defined

我没有更改包中的任何内容,也无法在网上找到任何与此相关的内容,导致此错误的代码是

with VideoFileClip(root) as video:
    new = video.subclip(int(frame / 60 - 5), int(frame / 60 + 5))
    new.write_videofile(f'{root.split(".")[0]}/{claim}{str(datetime.timedelta(seconds=int(frame / 60)))}', audio_codec='aac')

最佳答案

看起来他们接受了一个破坏代码的 PR。我设法通过进入decorators.py并将“func”的任何实例更改为“f”来修复它

关于python - moviepy subclip 函数中的名称错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72146529/

相关文章:

Python 正则表达式 : parsing newick format

在 Ubuntu 上支持 littlecms 的 Python PIL

python - 时间未定义 - python 类

python - 使用Python进行归并排序的一个bug

Python 'latin-1' 编解码器无法编码字符 - 如何忽略字符?

java - 在java中导入类文件

java - 线程 "main"java.lang.NullPointerException 中的异常 - 程序包

delphi - 在应用程序和包之间共享内存管理器

python - NameError:名称未在 python init 函数中定义

Python 名称错误 : name is not defined (related to having default input argument types)