Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solving the invalid name for Python module warning in PyDev

Tags:

python

pydev

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 - in the filename with _ but the warning didn't disappeared.

One of the problems is that in fact this is not a module, it's just a python script, still I get the warning and the warning says nothing about how to solve the issue.

What are the real requirements for filenames (not necessary modules) and where are they specified (PIP)?

How do I solve this problem in PyDev?

like image 999
sorin Avatar asked Sep 26 '11 08:09

sorin


1 Answers

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 | "_")*
like image 125
ThiefMaster Avatar answered Oct 07 '22 22:10

ThiefMaster