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

再次查看,報錯消失了。
