简体   繁体   English

IntelliJ Idea Python3代码索引错误

[英]IntelliJ idea Python3 code index error

There are common.py, environment.py and evaluation.py in the same directory and the Python version is 3.6 but in IntelliJ idea with Python plugin, Unresolved reference error is raised as you can see in the following picture 1. 在同一目录中有common.py,environment.py和Evaluation.py,Python版本为3.6,但在具有Python插件的IntelliJ idea中,出现了未解决的引用错误,如下图1所示。

图片1

And after changing common to .common , there is no error as you see in the following picture. 在将common更改为.common ,没有错误,如下图所示。

图片2

But the code cannot be run under Python 3.6, how can I change IntelliJ idea settings so that files can be indexed under the same folder and no errors will be reported in picture 1. 但是代码无法在Python 3.6下运行,我如何更改IntelliJ创意设置,以便可以在同一文件夹下建立文件索引,而在图1中不会报告任何错误。

您需要确保在项目结构对话框中,将包含common.py的目录标记为源根。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM