我正在尝试使用 Remote WSL 在 vscode 中调试 python 脚本使用 Python 3.9.1 进行扩展。
当我启动 Debug模式(F5)时,立即显示以下消息:
Couldn't find a debug adapter descriptor for debug type 'python' (extension might have failed to active)
留言给我 打开launch.json ,我仍然不知道我必须在我的 json 文件中更改什么,以下是我当前的设置:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"env": {
"PYTHONPATH": "c:/<my_user_name>/projects",
},
}
]
}
到目前为止我尝试过的:最佳答案
如果您在配置 WSL 之前已经安装了 VSCode,您可能会遇到这个问题。这是我解决它的方法:
Remote-WSL: New Window
这将在新窗口中打开 VSCode。祝你好运!
关于在 vscode 中找不到 python 调试适配器 - WSL :Ubuntu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65934783/