gpt4 book ai didi

python - 在 IntelliJ 中,显示 "No module named xxx",但 "xxx"实际上安装在我的系统中

转载 作者:太空宇宙 更新时间:2023-11-03 11:46:36 26 4
gpt4 key购买 nike

我的 IntelliJ 版本是 15.0.3,并且安装了 python 插件。

当我在 IntelliJ 中打开一个 python 文件时,它如下所示 enter image description here

这里的情况是这样的:

  1. 当我在终端中导入这些标记的模块时,一切正常。
  2. 在 IntelliJ 中运行这个 python 文件也可以

只有红色潜在警告让我恼火。

我试过了 this one , this onethis one ,但都不适合我。

谁能告诉我如何摆脱它?非常感谢。

最佳答案

您必须添加解释器的站点包路径。

为此你必须:

  1. 转到项目结构
  2. 选择全局图书馆
  3. 选择你的 Python 解释器
  4. 按左上角的+
  5. 选择您的解释器的站点包路径
  6. 选择“类(class)”

同样添加你的python解释器根目录。

关于python - 在 IntelliJ 中,显示 "No module named xxx",但 "xxx"实际上安装在我的系统中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38150837/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com