VsCode远程debug调试配置环境:
解决方案:
首先在你项目的文件夹下,创建一个.vscode文件夹,其实也是也可以按按按键来生成的,在ubuntu下,mkdir不是更加便捷嘛hhhh~~。然后,在.vscode文件夹下面创建3个json文件,launch.json、setting.json、task.json。
launch.json
文件配置
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: 当前文件",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"python": "/home/tzh/miniconda3/envs/lbase/bin/python3",
"justMyCode": true,
// "args": [
// "--lr", "0.4",
// "--iter", "4" ,
// "--epoch", "30",
// "--model", "CNN",
// ],
}
]
}
setting.json
文件配置
{
"python.pythonPath": "/home/tzh/miniconda3/envs/lbase/bin/python3"
}
task.json
文件配置
{
"version": "2.0.0",
"tasks": [
{
"label": "python",
"type": "shell",
"command": "/home/tzh/miniconda3/envs/lbase/bin/python3",
"args": [
"${file}"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$eslint-compact"
]
}
]
}
参考链接:
https://cloud.tencent.com/developer/article/1840922