使用pycharm调用模块后字体变灰
点击小灯泡提示出现以下内容: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
No matter what situation we face, no matter how contradictory our hearts are, we always have a choice. What kind of person we are depends on who we choose to be.