解决ImportError: cannot import name ‘parse_args‘ from ‘parser‘ (unknown location)

Problem Description

Use PyCharmopen project to run, appearImportError: cannot import name 'parse_args' from 'parser' (unknown location)

Traceback (most recent call last):
  File "C:\Users\1\Desktop\LightGCL-main\main.py", line 11, in <module>
    from parser import parse_args
ImportError: cannot import name 'parse_args' from 'parser' (unknown location)

insert image description here

Cause Analysis:

The error code is in from parser import parse_argsthis sentence. The reason for this problem is that the parserlibrary has the same name. I customized a parser.pyfile to import this file, but there is also a parserpackage installed in my environment. The default import is in the environment parser, so naturally I can’t find it. to the class function I defined.

solution:

parser.pyRename the custom

Guess you like

Origin blog.csdn.net/m0_47256162/article/details/130043271