错误: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.
错误截图
问题描述
pycharm显示无法引用到的这些类,即使这些类都在工程中,看看文件上方的import会发现对应的模块import不成功。
1、首先确认是否已成功引入相关包【找到python安装包,shift+右键-》在此处打开命令行窗口】
查看是否包含出错误的包
不存在:pip install xxx
存在:转至下
2、若包已存在,验证是否可用:
cmd->python
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.ylabel(‘some numbers’) #为y轴加注释
plt.show()
如若出现下面内容,说明包存在正常,排除包下载出错的问题
3、这个时候,首先检查你自己的文件,文件名是否与引用包名重复,或者与引用包所在文件夹重复,重命名后可恢复正常。
4、问题解决。