Debug launch configuration doesn't override Python interpreter
維護者通常 5 天內回覆
@eleanorjboyd 已經在處理了。
開始於 2025年11月10日。
評估
這個 Issue 還沒有評估資料。
描述
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.105.1 (Universal)
- OS Version: macOS 26.0.1
Issue:
I am using a multi-root workspace for my monorepo. I am using a monorepo.code-workspace file that roughly looks like the following:
{
"folders": [
{
"name": "root",
"path": "."
},
{
"name": "service_A",
"path": "service_A"
},
{
"name": "service_B",
"path": "service_B"
},
{
"name": "company_python",
"path": "company_python"
},
],
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "service_A",
"consoleName": "service_A",
"type": "debugpy",
"request": "launch",
"module": "uvicorn",
"args": [
"app.main:app",
"--reload",
"--reload-dir",
"${workspaceFolder:service_A}",
"--reload-dir",
"${workspaceFolder:root}/company_python",
],
"justMyCode": true,
"console": "integratedTerminal",
"env": {
"POETRY_ACTIVE": "1",
"PYTHONPATH": "${workspaceFolder:service_A}:${workspaceFolder:root}/company_python"
},
"cwd": "${workspaceFolder:service_A}",
"python": "${workspaceFolder:service_A}/.venv/bin/python",
"windows": {
"python": "${workspaceFolder:service_A}\\.venv\\Scripts\\python.exe"
}
},
{
"name": "service_B",
"consoleName": "service_B",
"type": "debugpy",
"request": "launch",
"module": "uvicorn",
"args": [
"app.main:app",
"--port",
"8001",
"--reload",
"--reload-dir",
"${workspaceFolder:service_B}",
"--reload-dir",
"${workspaceFolder:root}/company_python",
],
"justMyCode": true,
"console": "integratedTerminal",
"env": {
"POETRY_ACTIVE": "1",
"PYTHONPATH": "${workspaceFolder:service_B}:${workspaceFolder:root}/company_python"
},
"cwd": "${workspaceFolder:service_B}",
"python": "${workspaceFolder:service_B}/.venv/bin/python",
"windows": {
"python": "${workspaceFolder:service_B}\\.venv\\Scripts\\python.exe"
}
}
]
},
"settings": {
"files.exclude": {
"service_A": true,
"service_B": true
// "company_python": true,
},
"search.exclude": {
"service_A": true,
"service_B": true
// "company_python": true,
},
"python.analysis.extraPaths": [
"${workspaceFolder:root}/company_python"
],
"python.autoComplete.extraPaths": [
"${workspaceFolder:root}/company_python"
]
}
}
The lines that are important are:
"python": "${workspaceFolder:service_A}/.venv/bin/python",
When I hover over this, it hints at the following:
However, when I launch the debug configuration for either service_A or service_B, it does not use the path I configured in monorepo.code-workspace. Instead, VS Code look at which file is currently open, and checks which interpreter is configured 'locally'.
Even when I clear all settings regarding the interpreters, it still does not use the interpreter that I have configured in the debug launch config.
Steps to Reproduce:
- Use the
monorepo.code-workspacethat I provided above. - Create a
.venvfor bothservice_Aandservice_B. - To make sure this bug occurs, select the correct interpreters for both folders using the command
Python: Select Interpreteras shown in the screenshot above. - Have a .py file open that lives in the folder of
service_B. - Start the debug configuration for
service_A. - Check the integrated terminal to see that the debugger looks at the
.venvofservice_B.
- 主要語言
- TypeScript
- 星號
- 182
- 分支
- 125
- 平均合併
- 14 天 4 小時
- 30 天內合併 PR
- 2
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/vscode-python-debugger 的其他 Issue
-
triage-needed
難度 2/5 1-3 小時 新手友好度 78/100
microsoft/vscode-python-debugger#1110 ·
維護者通常 5 天內回覆
-
PowerShell script debugpy.ps1 incorrectly handles multiple arguments passed as an array可能已有人在做 @nightcityblade 於 39 天前認領。 未關閉triage-needed
難度 1/5 1-3 小時 新手友好度 88/100
microsoft/vscode-python-debugger#1024 · 1 則留言 ·
維護者通常 5 天內回覆
-
Update dependencies with actionable security alerts可能已有人在做 @copilot-swe-agent 於 19 天前認領。 未關閉triage-needed
microsoft/vscode-python-debugger#1111 · 1 個 reaction · 已指派 1 人 ·
維護者通常 5 天內回覆
-
Update vulnerable npm dependencies可能重新可做 關聯的 PR 已關閉且未合併。 未關閉triage-needed
microsoft/vscode-python-debugger#1104 · 1 個 reaction · 已指派 1 人 ·
維護者通常 5 天內回覆
-
triage-needed
難度 4/5 3-5 天 新手友好度 45/100
microsoft/vscode-python-debugger#1052 · 2 則留言 ·
維護者通常 5 天內回覆
查看 microsoft/vscode-python-debugger 的全部 Issue
相似的 Issue
-
area:docs bug triage:confirmed
難度 2/5 1-3 小時 新手友好度 74/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
anomalyco/models.dev#8862 · 1 則留言 ·
維護者通常 1 天內回覆
-
fix(data-lake): wizard source step still previews the local slug, not the server-disambiguated one未關閉data-lake
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
ready-for-triage
難度 1/5 1 小時以內 新手友好度 88/100
konflux-ci/konflux-ui#1596 · 1 則留言 ·
維護者通常 1 天內回覆
-
enhancement good first issue priority: low size: XS
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆