Skip to content

module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'? #513

@RoiTang

Description

@RoiTang

基本信息

  • 你使用的操作系统: windows10+pycharm

  • 你使用的Python版本: 3.11

  • 你加载的预训练模型:albert

核心代码

# 在snippets.py文件620行出现错误,错误信息如下:
# module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?

输出信息

# module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?

自我尝试

此原因为python3.7之后对于getargspec不再支持,将getargspec改为getfullargspec即可正常运行。
希望遇见这个问题的人可以这样解决。
或者有更好的解决方法请告知,谢谢。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions