Installation Guide
RMath is distributed as a pre-compiled Python wheel containing the Rust binary.
No Rust toolchain is required for standard installation —
just pip and Python 3.9+.
Quick Install
Requirements
| Requirement | Version | Notes |
| Python | 3.9 – 3.13 | CPython only (no PyPy) |
| Platform | Windows, Linux, macOS | x86_64 and arm64 wheels available |
| pip | 21.0+ | For wheel installation |
| NumPy (optional) | 1.21+ | Required only for .to_numpy() / .from_numpy() |
Verify Your Installation
After installing, run the following to confirm everything is working:
import rmath as rm
import rmath.vector as rv
import rmath.array as ra
v = rv.Vector([1.0, 2.0, 3.0])
print("sum:", v.sum())
print("mean:", v.mean())
a = ra.Array([[1.0, 2.0], [3.0, 4.0]])
print("array mean:", a.mean())
print("rmath OK ✓")
sum: 6.0
mean: 2.0
array mean: 2.5
rmath OK ✓
Building from Source
If you want the latest unreleased changes or need to modify the Rust core,
build from the GitHub repository. You will need the Rust toolchain.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
git clone https://github.com/Ay-developerweb/rmath
cd rmath
pip install maturin
maturin develop --release
Always use --release when building from source.
Rust debug builds disable all compiler optimisations — numerical kernels will
run 10–100× slower than the production wheel.
Available Submodules
After installation, the following submodules are importable:
import rmath
import rmath.array
import rmath.vector
import rmath.stats
import rmath.linalg
import rmath.calculus
import rmath.geometry
import rmath.signal
import rmath.nn
import rmath.special
import rmath.constants
print("All imports: OK")
All imports: OK