psutil-android
psutil, repackaged so it installs and imports as psutil inside
Termux on Android — no compiler, no NDK, no source build needed
on-device.
⚠️ Termux only. This does not run on stock Android, Pydroid, QPython, Chaquopy, or any other embedded-Python runtime. See Why this is Termux-specific below for exactly why, verified via
readelf.
Structure
psutil/
_native/
aarch64/_psutil_linux.abi3.so, meta.json
arm/_psutil_linux.abi3.so, meta.json
i686/_psutil_linux.abi3.so, meta.json
x86_64/_psutil_linux.abi3.so, meta.json
_native_loader.py <- picks the right .so for platform.machine() at import time
_android_compat.py <- if loading fails, gives an exact reason instead of
a bare "cannot open shared object file"
__init__.py, _common.py, _pslinux.py, ... <- upstream psutil, unmodified
Each .so is extracted from Termux's own python-psutil package build
(ghcr.io/termux/package-builder + termux/termux-packages' actual
recipe), so it's linked correctly against that arch's Termux libc/
libpython — not a generic NDK cross-compile guess. meta.json next to
each .so is generated from the binary's real NEEDED entries
(.github/scripts/gen_meta.py, via readelf), not hand-typed, so it
can't drift from what the binary actually requires.
As of the current release, all four arches (aarch64, arm, i686,
x86_64) are built by CI and bundled in every published wheel — one
wheel works across every Termux-supported CPU. _native_loader.py
auto-selects the right one at import time.
Why this is Termux-specific, not "any Android device"
Every bundled .so is hard-linked (RUNPATH) against Termux's own
runtime, confirmed via readelf -d on all four arches:
RUNPATH: /data/data/com.termux/files/usr/lib
NEEDED: libandroid-support.so, libpython3.14.so, libc.so
So even with every arch bundled, this only runs where all of the following hold:
- Termux is installed (not stock Android, not Pydroid/QPython/
Chaquopy — none of those have
libandroid-support.soor Termux'slibc.soshim) - CPU arch matches one of the bundled binaries (aarch64/arm/i686/x86_64 covers every arch Termux itself ships for)
- Termux's Python minor version matches what that arch's binary was
linked against (currently 3.14.x for all four, recorded per-arch in
meta.json; each Termux Python update can require a rebuild — just re-run the release workflow)
When any of that doesn't hold, import fails with a specific diagnosis
(_android_compat.py), not a cryptic OS error — and suggests the
fallback: pkg install clang make && pip install psutil, which compiles
real upstream psutil from source on-device and isn't tied to any of the
above at all. That's the actually version-proof path; the bundled
binaries exist to skip needing a compiler on-device.
Tested on:
Linux localhost 5.10.136-android12-9-00005-gf9a66cbe7091-ab9177899 #1 SMP PREEMPT
Fri Oct 14 05:14:18 UTC 2022 aarch64 Android
Install
From PyPI:
pip install psutil-android
From a downloaded wheel or the release assets:
pip install psutil_android-7.2.4-py3-none-any.whl
Either way it installs as the psutil package name — don't install
alongside real psutil in the same environment.
Usage
import psutil
psutil.cpu_percent(interval=1)
psutil.virtual_memory()
psutil.disk_partitions()
Provenance
This is Giampaolo Rodola's psutil (BSD-3-Clause, see LICENSE),
unmodified at the Python level. There is no dedicated upstream "psutil
for Android" project — Android support has been an open, unresolved
request on giampaolo/psutil for years (issues #913, #2611, #2743).
This package fills that gap for Termux users.
License
BSD 3-Clause, inherited from upstream psutil. See LICENSE.
👤 Maintainer
Metadata
Release files for psutil-android 7.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| psutil_android-7.2.6.tar.gz | 130.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| psutil_android-7.2.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 277.4 kB
Release files / psutil_android-7.2.6.tar.gz
| Download URL | psutil_android-7.2.6.tar.gz |
|---|---|
| Size | 130.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc935ce1f66eec8e9382bf801650a6e0dba2141414d63474866c71bcc4ab93c0
|
|
BLAKE2b-256 checksum How to use checksums |
49999974972307aad51f7385a9b085a1f672aecf493fe0a84ac70ff3fd2c5865
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.
Transparency logRelease files / psutil_android-7.2.6-py3-none-any.whl
| Download URL | psutil_android-7.2.6-py3-none-any.whl |
|---|---|
| Size | 146.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
586f65199b2434a5d25a56f1c78acbb41f5bcf13a4ab552644145c68b2c47b81
|
|
BLAKE2b-256 checksum How to use checksums |
3f23e6737715b8a6843648a400780b23baca7597b4d4a5edcc7474deec231e82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.
Transparency log