Skip to main content

py-spy-tui

A Rust terminal UI for py-spy, packaged so users can install it with:

pip install py-spy-tui
py-spy-tui

py-spy-tui depends on the py-spy Python package, so installing the TUI also installs the profiler binary on supported platforms.

Current Features

  • Groups Python processes by distributed training metadata, process tree, runtime prefix, working directory, and command fingerprint.
  • Detects virtualenv, uv-managed Python, Conda, pyenv, and system runtimes.
  • Shows PyTorch rank metadata when process environment is readable.
  • Explains Linux rootless profiling setup before asking sudo to attach to a process.
  • Uses sudo -v for authentication and never reads or stores a password.

Usage

py-spy-tui

Non-interactive checks:

py-spy-tui --help
py-spy-tui --version

Keys:

  • Enter: record the selected process or process group for 30 seconds.
  • d: run py-spy dump for the selected process or process group.
  • t: run live py-spy top for the selected process.
  • r: refresh process groups.
  • Space: expand or collapse a group.
  • j / k or arrow keys: move selection.
  • PageUp / PageDown: scroll output.
  • q: quit.

When a group is selected, py-spy-tui runs one py-spy command per process. This is useful for torchrun and distributed PyTorch training, where ranks are often sibling processes rather than children of a single attach target.

Live top is available for one selected process at a time. For multiprocessing and torchrun/DDP sibling ranks, use group recording.

Reports

Every record run creates a recognizable report folder in the current directory:

py-spy-report-<target-name>-<unix-timestamp>/
  raw/
    pid-1234.svg
    pid-1235.svg
  report.md
  report.json

The raw/ folder keeps py-spy's original SVG records. report.md is written for humans, and report.json is structured so you can pass the folder to an LLM and ask it to compare hot frames, rank imbalance, blocking stacks, and data-loading stalls.

Linux Rootless Profiling

Attaching to an existing process often requires elevated permissions on Linux. To allow same-user profiling without sudo:

sudo sysctl kernel.yama.ptrace_scope=0

To keep that setting after reboot:

echo 'kernel.yama.ptrace_scope=0' | sudo tee /etc/sysctl.d/10-py-spy-tui.conf
sudo sysctl --system

This changes system-wide ptrace policy for same-user debugging. Use sudo from the TUI when you prefer not to change the host setting.

Build

Local full check:

just build-all

That runs formatting, tests, clippy, clears dist/, builds a wheel, and smoke-checks it. It also runs just verify-dist, which fails unless dist/ contains only wheels and includes the required macOS and Linux manylinux x86_64/aarch64 wheel tags.

Build a local wheel:

just dist-local

Linux release wheels are built as manylinux wheels with Zig so they work on most supported Linux distributions:

just dist-linux-x86_64
just dist-linux-aarch64

Check release artifacts without rebuilding:

just verify-dist

Metadata

Release files for py-spy-tui 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for py-spy-tui 0.1.10
File Interpreter ABI Platform Actions
py_spy_tui-0.1.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for py_spy_tui-0.1.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
py_spy_tui-0.1.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for py_spy_tui-0.1.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
py_spy_tui-0.1.10-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for py_spy_tui-0.1.10-py3-none-macosx_11_0_arm64.whl

Total release size: 1.9 MB

Release files / py_spy_tui-0.1.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL py_spy_tui-0.1.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 668.2 kB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
e1e8b35eb37cc07962604610e8488cc0305e8e70e1c2c931e398c6ec64368f09
BLAKE2b-256 checksum
How to use checksums
e69ccdee887d93ac8e1d2a7ecfe361012cfd6b446ef74b42581b36e1430229f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / py_spy_tui-0.1.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL py_spy_tui-0.1.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 638.0 kB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
b3f7b48df91f69277c1932edb761b13579df956261f26355655368cfd46e348e
BLAKE2b-256 checksum
How to use checksums
8344ba3d4b54d7c6ecc66bdee6ecca826d26f500d42477d231ae9e49e6acbd09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / py_spy_tui-0.1.10-py3-none-macosx_11_0_arm64.whl

Download URL py_spy_tui-0.1.10-py3-none-macosx_11_0_arm64.whl
Size 572.3 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fd3e0043fbfa86e179ed47c953f04abb1a97cbe0420b02e756de8ee6677ea782
BLAKE2b-256 checksum
How to use checksums
fa3d00b553ebbf9c416ad13884687b43cccd2e4334e3911558582910f67eef21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for py-spy-tui 0.1.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page