【问题标题】:Python select interpreter not found VS Code找不到 Python 选择解释器 VS Code
【发布时间】:2022-09-26 13:47:26
【问题描述】:

我开始在 Visual Studio Code 上使用 venvs,当我尝试使用 pandas 时,import pandas

它给了我这个错误

\"导入\"pandas\" 无法从源解析\"

所以我尝试使用ctrl+shift+p 更改vscode 中的python 解释器,我收到此错误

\"命令 Python 导致错误(未找到命令 \'python.setInterpreter\')。

    标签: python visual-studio-code interpreter python-venv


    【解决方案1】:

    对我来说,从受限模式转换到受信任的窗口模式是有效的。

    只需单击底部的受限窗口,然后在弹出窗口中选择“信任”即可。

    [https://code.visualstudio.com/docs/editor/workspace-trust#_extensions][1]

    【讨论】:

      【解决方案2】:

      我建议两种方法来解决这个问题,首先卸载并重新安装扩展。在 Linux(我相信还有 MacOS)上,删除 ~/.vscode/extensions/ 然后手动重新安装会有所帮助。如果这不起作用,您可以尝试手动设置 python 解释器(请参阅:vscode documentation on manually specifying an interpreter)。

      欲了解更多信息,我建议您浏览How to start debugging Python 3.6 in Visual Studio Code?

      【讨论】:

        猜你喜欢
        • 2019-08-05
        • 2022-07-01
        • 1970-01-01
        • 2020-04-30
        • 2022-01-13
        • 2021-05-06
        • 1970-01-01
        • 2020-03-13
        • 2020-12-23
        相关资源
        最近更新 更多