點擊小燈泡提示出現以下內容: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.
上面大致意思:
import 不能識別自定義包名,該類或者包沒有灌入python引入庫中
解決方法:
File下有invalidate caches/restart選項,點擊即可
如果不行使用
解決方案:右擊pycharm中項目名-->Mark Directory as -->Resource root