python-debugpy

Debug Python code with pdb breakpoints and debugpy remote DAP sessions.

1|Updated Jun 19, 2026
One-click install
npx skills add https://github.com/Lento47/arcana-community --skill python-debugpy-lento47
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: python-debugpy
Source: https://github.com/Lento47/arcana-community/tree/main/skills/software-development/python-debugpy
Command: npx skills add https://github.com/Lento47/arcana-community --skill python-debugpy-lento47

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires debugpy, remote-pdb.

What problem does it solve? Diagnosing Python bugs in tests, scripts, and long-running processes is hard when tracebacks alone don't reveal why values are wrong, and restarting misbehaving daemons or subprocesses to add print statements is slow or impossible. ## Core Features & Use Cases - Interactive pdb debugging: Set breakpoints with breakpoint(), step through code, inspect locals, and run post-mortem analysis on exceptions. - Remote debugging with debugpy: Attach to already-running processes via DAP, or use remote-pdb for a terminal-friendly pdb prompt over a socket. - Pytest integration: Drop into pdb on test failures with --pdb, handling the xdist incompatibility that silently hangs test runs. - Use Case: A gateway subprocess misbehaves in production-like conditions. Add remote_pdb.set_trace() in the suspect handler, trigger the code path, connect with nc 127.0.0.1 4444, and inspect the live call stack and variables without restarting the service. ## Quick Start Add a breakpoint() call at the suspect line in my Python file and walk me through inspecting the variables when execution pauses there.

Frequently Asked Questions about python-debugpy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug Python code with breakpoints?▼

Add breakpoint() at the line you want to inspect and run the script normally; execution pauses there with a pdb prompt. From the prompt you can print variables with p, step with n or s, and view the stack with w.

How to attach a debugger to a running Python process?▼

Use debugpy with python -m debugpy --listen 127.0.0.1:5678 --pid <pid> to inject into a running process, then connect a DAP client. Alternatively, insert remote_pdb.set_trace() in the code and connect via nc to get a standard pdb prompt.

debugpy vs remote-pdb for terminal debugging?▼

remote-pdb gives a plain pdb prompt over a socket connection, which suits terminal-based workflows. debugpy speaks the DAP protocol and is the better choice when you need IDE integration with VS Code, thread-aware debugging, or scripted breakpoint control.

Why does pdb not work when running pytest?▼

pdb does not work under pytest-xdist, which many test runners enable by default; the test hangs without showing a prompt. Disable parallelism with -p no:xdist or -n 0, then use --pdb to drop into the debugger on failure.

Why is my breakpoint() call not hitting?▼

Check whether PYTHONBREAKPOINT=0 is set, which disables all breakpoint() calls. Other common causes are running under pytest-xdist, or the process finishing execution before a remote debug client attached.

Can pdb debug multithreaded or async Python code?▼

pdb only debugs the current thread and does not follow forks, so each thread or child process needs its own trace hook. For multithreaded code use debugpy, which is thread-aware; for asyncio, await inside pdb requires Python 3.13+ or workarounds on older versions.