Unable to run a Python module in a subprocess when `subProcess: true`
@rchiodo đang làm issue này rồi.
Từ ngày 23/2/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
The following script executes a Python module in a subprocess.
# main.py
import subprocess
import sys
subprocess.run([sys.executable, "-m", "sub"])
# sub.py
print("Hello, world!")
// launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"subProcess": true,
}
]
}
Running this in the debugger with "subProcess": true fails:
bash-3.2$ cd /Users/pete/projects/subprocess_test ; /usr/bin/env /Users/pete/projects/subprocess_test/.venv/bin/python /Users/pete/.vscode/extensions/ms-python.debugpy-2025.18.0-darwin-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher 56894 -- /Users/pete/projects/subprocess_test/main.py
No module named sub
Running it with "subProcess": false works as expected:
bash-3.2$ cd /Users/pete/projects/subprocess_test ; /usr/bin/env /Users/pete/projects/subprocess_test/.venv/bin/python /Users/pete/.vscode/extensions/ms-python.debugpy-2025.18.0-darwin-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher 57618 -- /Users/pete/projects/subprocess_test/main.py
Hello, world!
OS: Darwin arm64 25.3.0
VSCode: 1.109.5 (Universal)
Python Debugger: 2025.18.0
Python: 3.14.2 (in a virtualenv)
- Ngôn ngữ chính
- Python
- Star
- 2.5k
- Fork
- 202
- Merge trung bình
- 5 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/debugpy
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Document "rules"-option Đang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Adapter bootstrap fails with ConnectionRefusedError on WSL2 VirtioProxy or hostAddressLoopback Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Tất cả issue của microsoft/debugpy
Issue tương tự
-
essnmx good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
[Feature] 奇物选择添加优先级 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
syfoud/Simulated_Scepter#174 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Giskard-AI/giskard-oss#2840 · 1 bình luận ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Đang mởarea: repo bug perceived difficulty: 2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
yeti-platform/yeti#1380 ·