最近使用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”

再次查看,报错消失了。

 

posted on 2018-01-10 14:25  NancyRM  阅读(4371)  评论(1编辑  收藏  举报