pycharm introduced into the same folder .py error solutions

When using pycharm write python program, I found it impossible to import files in the same folder .py

The following error:

But two files are in the folder in the same file, import failed error appears:

To solve this problem, right-click the folder and select sources root Mark Directory as the

Finally, the problem is solved, the import was successful

Guess you like

Origin www.cnblogs.com/hspzm/p/12577171.html