Solving the invalid name for Python module warning in PyDev

后端 未结 2 1063
执笔经年
执笔经年 2020-12-31 08:52

I encountered the Invalid name for Python module: ...filename (it\'ll not be analyzed) warning message in PyDev and I tried to resolve it by replacing -

相关标签:
2条回答
  • 2020-12-31 09:26

    See http://docs.python.org/tutorial/modules.html for information about modules.

    To find out what characters are valid, have a look at the syntax of the import statement. It shows you that a module name needs to be a valid identifier which has the following rule:

    identifier ::=  (letter|"_") (letter | digit | "_")*
    
    0 讨论(0)
  • 2020-12-31 09:50

    I had the similar message and when I checked the script file name, I had a "-" [dash character] in the script name. After I removed the dash character and replaced with " _ " [an under score character], the warning message was gone.

    0 讨论(0)
提交回复
热议问题