python用from *** import *** 时出现红色波浪线,但是代码可以正常运行,点开more查看更多信息时可以看到:
Inspection info: 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.
检查左侧的目录结构:
发现mydb_test所在的目录是一个package。
解决方法:右击包名-- Mark Directory as – Resource root 即可