[VSCode Python扩展在Windows 10上更新后找不到python

问题描述 投票:-1回答:1

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

python from cmd

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

如果单击“选择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个回答
0
投票

[如果有人偶然发现了Google的这个线程,我通过以下方法解决了问题:

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

© www.soinside.com 2019 - 2024. All rights reserved.