【发布时间】: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