python-debugpy

Diagnose Python defects by pausing execution and inspecting runtime state with pdb or debugpy over DAP.

Updated May 15, 2026
One-click install
npx skills add https://github.com/cabezno/bmb-encover-agent --skill python-debugpy-cabezno
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-debugpy
Source: https://github.com/cabezno/bmb-encover-agent/tree/main/skills/software-development/python-debugpy
Command: npx skills add https://github.com/cabezno/bmb-encover-agent --skill python-debugpy-cabezno

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) components.

What problem does it solve?

It helps you find the real cause of Python bugs by letting you pause execution, inspect state, and step through code using pdb and debugpy DAP.

Core Features & Use Cases

  • Interactive local debugging with pdb: Drop into a REPL at a chosen line (via breakpoint()) or start a script under pdb to inspect locals and control execution.
  • Remote/headless debugging with debugpy (DAP): Attach to long-running processes or attach to an already-running PID so you can debug gateway-like services without restarting cleanly.
  • Operational debugging workflows: Supports pytest failure debugging and post-mortem inspection to examine the crashing frame and its local variables.

Quick Start

Use debugpy for a failing long-running process by setting debugpy.listen on 127.0.0.1:5678, waiting for a client, and triggering your breakpoint so you can inspect locals through a DAP client.

Frequently Asked Questions about python-debugpy

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

FAQPage Schema
How do I debug a running Python process without restarting it?

Remote debugging a running Python process uses debugpy to attach to a live PID via DAP. You set debugpy.listen on a port like 5678, wait for a client, and inspect state through a DAP-compatible client without restarting the service.

What is the best way to debug pytest failures locally?

Debugging pytest failures uses pdb post-mortem to examine the crashing frame and its local variables. You drop into a REPL at the failure point via breakpoint() or start the test under pdb to step through and inspect runtime state interactively.

How does Python remote debugging over DAP work?

Python remote debugging over DAP works by having debugpy listen on a port like 127.0.0.1:5678 and wait for a client connection. Once a DAP-compatible client attaches, you trigger breakpoints to pause execution and inspect local variables remotely.

Can I use pdb to inspect variables after an unhandled exception?

Yes, pdb supports post-mortem inspection to examine variables after an unhandled exception. It drops you into a REPL at the exact crashing frame, allowing you to inspect local state and diagnose the defect without modifying code.

What is the difference between pdb and debugpy for Python debugging?

pdb provides interactive local debugging via breakpoint-driven REPL inspection in the terminal, while debugpy enables remote and headless debugging over DAP. Use debugpy for long-lived services or subprocesses where restarting is difficult, and pdb for local bug isolation.