Debug launch configuration doesn't override Python interpreter
@eleanorjboyd arbeitet bereits daran.
Seit 10.11.2025.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 181
- Forks
- 126
- Ø Merge
- 8 Std. 49 Min.
- Gemergte PRs (30 T.)
- 1
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/vscode-python-debugger
-
triage-needed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
microsoft/vscode-python-debugger#1110 ·
-
triage-needed
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
microsoft/vscode-python-debugger#1024 · 1 Kommentar ·
-
triage-needed
microsoft/vscode-python-debugger#1111 · 1 Reaktion · 1 zugewiesene Person ·
-
triage-needed
microsoft/vscode-python-debugger#1104 · 1 Reaktion · 1 zugewiesene Person ·
-
triage-needed
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 58/100
microsoft/vscode-python-debugger#1095 · 1 Kommentar · 1 Reaktion ·
Alle Issues in microsoft/vscode-python-debugger
Ähnliche Issues
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
-
Mend: dependency security vulnerability untriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100