Microsoft's Debug Adapter Protocol implementation for Python
open sourceMITfree
debugpy is Microsoft's implementation of the Debug Adapter Protocol for Python 3, so any DAP client (an editor or IDE) can debug Python code. Run a script or module under it with python -m debugpy --listen <port>, optionally waiting for the client to attach, attach to a running process by its ID, or call debugpy.listen() from your own code; listening on a public interface lets you debug from another machine.
Problems it solves
- debug a Python script from my editor
- attach a debugger to a Python process running in a container
- set breakpoints in Python code running on a remote machine
Features
- Debug Adapter Protocol server for Python 3
- run scripts or modules under the debugger from the command line
- attach to a running process
- wait for the client before running code
- remote debugging over a network interface
- debugpy.listen() API to start it from code
Limitations
- Anyone who can connect to its listening port can run arbitrary code in the debugged process, so expose it only on secure networks.1
Alternatives
The same job
These do what debugpy does.
- Python Debugger Python debugging with debugpy for Visual Studio Code
- Delve The debugger for the Go programming language
- CodeLLDB A VS Code debugger for native code, powered by LLDB
- js-debug Microsoft's JavaScript debugger for Node.js and browsers, built into VS Code and available as a DAP server
- Debugger for Java Microsoft's Java debugger for VS Code
