【问题标题】:VSCode Python extension cannot find python after update on windows 10VSCode Python 扩展在 Windows 10 上更新后找不到 python
【发布时间】:2020-05-30 15:35:53
【问题描述】:

我今天早上更新了 VSCode“python”扩展,现在它找不到 python。我将 python 安装到“C:\Python37\”并将其添加到路径中。从 CMD 运行 python 可以,如:

所以我的 python 安装没有问题。启动 VSCode 我在右下角看到这个:

如果我单击“选择 python 解释器”,它会显示我尝试在 settings.json 中硬编码 python 路径的位置,但我无法选择任何内容。

{"python.pythonPath": "C:/Python37/python.exe"}

我在 google 上找到了一个似乎与我的问题相关的帖子:
https://github.com/microsoft/vscode-python/issues/3535

通过这些步骤,我启用了开发工具并查看了错误日志以找到第一个错误,该错误出现在此处:

console.ts:137 [Extension Host] Error Python Extension: 2020-02-14 15:16:22: Failed to get interpreter information for 'C:/Python37/python.exe' [Error: spawn C:\WINDOWS\system32\cmd.exe; ENOENT   at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)   at onErrorNT (internal/child_process.js:456:16) at processTicksAndRejections (internal/process/task_queues.js:84:9)] {  errno: 'ENOENT',  code: 'ENOENT',  syscall: 'spawn C:\\WINDOWS\\system32\\cmd.exe;',  path: 'C:\\WINDOWS\\system32\\cmd.exe;',  spawnargs: [    '-c',    '"C:/Python37/python.exe" ' +      '"c:\\Users\\tbarker1\\.vscode\\extensions\\ms-python.python-2020.2.63072\\pythonFiles\\interpreterInfo.py"'  ],  cmd: '"C:/Python37/python.exe" ' +    '"c:\\Users\\tbarker1\\.vscode\\extensions\\ms-python.python-2020.2.63072\\pythonFiles\\interpreterInfo.py"'}

【问题讨论】:

    标签: python visual-studio-code vscode-settings


    【解决方案1】:

    如果有人偶然发现谷歌的这个帖子,我通过以下方式解决了这个问题:

    单击 vscode 中的扩展选项卡
    右键单击 python 扩展
    点击“安装以前的版本”
    安装了大约 6 个月前的旧版本

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-05-10
      • 1970-01-01
      • 1970-01-01
      • 2019-06-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多