pystack
Analysis of the stack of remote python processes
What it is and what it does
PyStack is a command-line debugger that attaches to running Python processes or analyzes core dump files to extract and display their call stacks. It works by reading process memory directly, making it safe for production use since it does not execute code or modify memory in the target process. The tool can show which threads hold the Python GIL, whether garbage collection is running, and optionally display native C/C++/Rust frames alongside Python frames, local variables, and function arguments.
The package is built on low-level system introspection and is designed to work even with optimized or stripped Python binaries. It supports multiple interpreters in the same process and can tolerate memory corruption, making it useful for diagnosing hangs, deadlocks, and crashes in production systems. PyStack requires Linux and system libraries (libdw, libelf) to build, but pre-built wheels are available for Python 3.9 through 3.15.
Use it for:
- Diagnose why a production Python service is hanging or unresponsive by inspecting its current call stack without restarting.
- Analyze a core dump from a crashed Python process to understand the execution state at the time of failure.
- Debug deadlocks or GIL contention by checking which threads hold the lock and what code they are running.
- Inspect native function calls mixed with Python frames to troubleshoot crashes in C extensions or mixed-language code.
- Examine local variables and function arguments in stack frames to understand program state without interactive debugging.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyStack inspects the stack frames of a running Python process or core dump file, showing what code is executing or what caused a crash, without modifying the target process.
Yes, if you develop or operate Python services on Linux and need non-intrusive runtime diagnostics. PyStack fills a gap between interactive debuggers (which require stopping execution) and coarse-grained monitoring. The active maintenance, zero security vulnerabilities, permissive license, and broad Python version support make it low-risk. The main barrier is the Linux-only requirement and system library dependencies; if you're on a different OS or cannot install libdw and libelf, it is not an option.
Install
pystack on PyPI
pip
pip install pystackuv
uv add pystackpoetry
poetry add pystackInstalling pystack
Before you install
Medium install friction due to compiled C extensions requiring libdw and libelf system libraries. The package is actively maintained with recent releases and broad wheel coverage across Python 3.9–3.15 on Linux platforms.
License in practice
Apache-2.0 is permissive; you may use, modify, and distribute PyStack freely in commercial and open-source projects, provided you include a copy of the license and state any changes.
Quickstart
pip install pystack
pystack remote <PID>
# or for core dumps:
pystack core <core_file> [executable]
Linux only; requires libdw and libelf system libraries installed. Building from source requires pkg-config or manual configuration of library paths.
Verify before relying
- Whether PyStack can safely inspect processes under heavy load or with memory corruption without data loss.
- Performance characteristics when analyzing very large core files or processes with thousands of threads.
- Compatibility with non-CPython implementations or alternative Python distributions.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 7 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 335,257/month — #7,477 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pystack-1.7.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pystack-1.7.1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pystack-1.7.1-cp310-cp310-musllinux_1_2_x86_64.whl; pystack-1.7.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pystack-1.7.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pystack-1.7.1-cp311-cp311-musllinux_1_2_x86_64.whl; pystack-1.7.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pystack-1.7.1-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pystack-1.7.1-cp312-abi3-musllinux_1_2_x86_64.whl; pystack-1.7.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pystack-1.7.1-cp313-cp313t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pystack-1.7.1-cp313-cp313t-musllinux_1_2_x86_64.whl; pystack-1.7.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pystack-1.7.1-cp314-cp314t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pystack-1.7.1-cp314-cp314t-musllinux_1_2_x86_64.whl; pystack-1.7.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pystack-1.7.1-cp315-cp315t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pystack-1.7.1-cp315-cp315t-musllinux_1_2_x86_64.whl; pystack-1.7.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pystack-1.7.1-cp39-cp39-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Tags
More Debuggers packages
Extracts and displays stack frame and traceback…
permissive · top 1,000 on PyPI
debugpydebugpy is a Debug Adapter Protocol…
permissive · top 1,000 on PyPI
pylintPylint is a static code analyzer that checks…
copyleft · top 1,000 on PyPI
yamllintyamllint checks YAML files for syntax errors,…
copyleft · top 1,000 on PyPI
ipdbipdb is an IPython-enabled debugger that…
permissive · top 5,000 on PyPI
memrayMemray is a memory profiler for Python that…
permissive · top 5,000 on PyPI
crashtestCrashtest provides utilities to catch, inspect,…
permissive · top 1,000 on PyPI
py-spypy-spy is a sampling profiler that attaches to…
permissive · top 1,000 on PyPI
mozcrashExtracts and formats stack traces from minidump…
copyleft · top 15,000 on PyPI
tracebackturbo3A drop-in replacement for Python's traceback…
permissive · top 15,000 on PyPI
esp-coredumpRetrieves and analyzes core dumps from ESP32…
permissive · top 5,000 on PyPI
pyinstrumentPyinstrument is a statistical call-stack…
permissive · top 5,000 on PyPI
pycrashreportParses Apple crash reports (iOS, macOS) into a…
copyleft · top 15,000 on PyPI
py-healthcheckProvides healthcheck and environment-dump…
permissive · top 15,000 on PyPI
pytest-memrayA pytest plugin that integrates memray memory…
permissive · top 5,000 on PyPI