Pychorm提示Unresolved reference 导入模块报错

最近使用Pychorm编写Python时,每次要引入自定义模块,就会报错,提示“Unresolved reference”

Unresolved reference 'LoginClass' more... (Ctrl+F1) 

This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items.

百度试了很多方法,结果都没用,最后很简单用一步就解决了,大家都可以试试

右击被调用模块存在的文件夹,“MarkDictionary as”-->“Sources root”

再次查看,报错消失了。

原文地址:https://www.cnblogs.com/NancyRM/p/8258372.html