Python file calls another file and reports an error

Open a GitHub project, "from (package) import (file)" error, check many methods, can not solve it!
I discover a problem, the new package has a python " the init .py" file, but the project is not inside the package file:
checked the effect of the file:

The first function of init.py is to identify the package. If there is no such file, the directory will not be considered as a package.

Specific can refer to: Python module __init__.py role
when import therefore may not recognize the IDE, so the error, try to add a "package in which the init .py" file is empty you can run again, not Report an error again!

Guess you like

Origin blog.csdn.net/liulanba/article/details/114527942