Python在 VS 代码中无法识别已安装的模块

问题描述

一切都很好,直到我开始更改“launch.json”文件解决其他一些问题。但是,我和以前一样:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information,visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0","configurations": [
        {"name":"Python: Current File","type":"python","request":"launch","program":"${file}","console":"integratedTerminal"},{
            "name": "Python: Current File","type": "python","request": "launch","program": "${file}","console": "integratedTerminal"
        }
    ]
}

之后,当我运行我的代码时,导入模块的前几行,例如导入熊猫作为 pd, 然后它向我显示 ModuleNotFoundError: No module named 'pandas'。 但如果我尝试在 Jupyter 中导入,则完全没有问题。

不确定我是否应该卸载 VScode 或其他东西。感谢您的任何建议!

  • 回复自己,还没搞清楚,不过我觉得跟python路径有关。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)