python cannot find reference xxx in imported module xxx

Love The Way You Lie 2023-10-02 22:01 153阅读 0赞

解决python cannot find reference xxx in imported module xxx

在这里插入图片描述
第一种:FileSettingsEditorFile TypesIgnore files and folders,去掉框框中的:init.py;,然后:OK等待重新文件扫描。
第二种:FileInvalidate Caches / Restart,选择Invalidate and Restart,等待重新扫描库文件就好了。

其他方式:
PyCharm -> File -> Settings -> Build,Excution,Deployment -> Console -> Python Console 然后在 Add sources roots to PYTHONPATH旁边打勾
在这里插入图片描述
PyCharm -> File -> Settings -> Project(Project : pythonProject) -> Project Structure 然后选中文件夹右键把Sources选上

在这里插入图片描述

如果仍然存在问题
例如torch_ecg.torch_ecg.错误。这个问题就得看看你这个文件在不在了。重新下载该文件导入即可
在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,153人围观)

还没有评论,来说两句吧...

相关阅读