When pycharm py import local files, a red wavy line under the module to solve

1, enter the settings, find Python Console in the Console, check the option "Add source roots to PYTHONPAT" I did not do this step has always been checked on
Here Insert Picture Description
2 projects in the current program directory, right-click, then "Mark Directory as" as "Sources Root". After the current program directory color will change, it said that it has completed mark.
Here Insert Picture Description

3, after the introduction of the program part of the wave will disappear below the line, but also can "Ctrl + Alt + B" of the source view.
Here Insert Picture Description

Summary: The reason is because the red wavy line local path has not been marked "Source Catalog"

Published 124 original articles · won praise 141 · views 160 000 +

Guess you like

Origin blog.csdn.net/weixin_36838630/article/details/105159204