Installation#
rustmatrix ships pre-built wheels for every supported platform, so the
one-liner is the same everywhere:
pip install rustmatrix
Only fall back to a source build if a wheel isn’t available for your platform or you want to hack on the Rust kernels.
Pre-built wheels#
Wheels are published to PyPI on every release. The matrix:
OS |
Architectures |
Python versions |
|---|---|---|
macOS |
arm64, x86_64 |
3.10 – 3.13 |
Linux (manylinux2014) |
x86_64, aarch64 |
3.10 – 3.13 |
Windows |
x86_64 |
3.10 – 3.13 |
The wheels are abi3, so one wheel per OS × arch works across Python
versions from 3.10 onwards.
pip install rustmatrix
Apple Silicon (arm64) and Intel (x86_64) wheels are published
separately; pip picks the right one based on your interpreter.
pip install rustmatrix
Manylinux2014 wheels for x86_64 and aarch64. If you’re on a very
old distribution (glibc < 2.17), the wheel won’t load; use the source
build below.
pip install rustmatrix
A single x86_64 Windows wheel. If you’re on Windows on ARM, follow
the source build path.
From source#
A source build compiles the Rust extension. You need a C toolchain,
Rust (stable, ≥ 1.82 works), and pip — no Fortran, no BLAS.
xcode-select --install
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
pip install rustmatrix --no-binary rustmatrix
# Debian / Ubuntu — adjust for your distro
sudo apt install build-essential
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
pip install rustmatrix --no-binary rustmatrix
Install Visual Studio Build Tools (C++ workload).
Install Rust via rustup-init.exe.
From a Developer PowerShell:
pip install rustmatrix --no-binary rustmatrix
Development install#
For hacking on rustmatrix itself:
git clone https://github.com/swnesbitt/rustmatrix.git
cd rustmatrix
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -U pip maturin
pip install -e ".[test]"
maturin develop --release
pytest tests/
maturin develop --release builds the Rust extension in-place and
installs rustmatrix as an editable package. Re-run it whenever you
touch src/*.rs.
Verifying the install#
python -c "import rustmatrix; print(rustmatrix.__version__)"
For a real first calculation, see Quickstart.
Troubleshooting#
“No matching wheel”: you’re on a platform without a published wheel (Windows on ARM, musl Linux, or a very old glibc). Follow the source-build instructions above.
ImportError: cannot import name '_core': the Rust extension
didn’t build or didn’t install. If you’re developing, run
maturin develop --release again. If you pip installed, try
pip install --force-reinstall rustmatrix.
Apple Silicon NumPy ABI: if you see symbols missing from NumPy, make sure you haven’t mixed a conda NumPy with a pip-installed rustmatrix. Use one or the other consistently in a given environment.
maturin develop fails with “no virtual environment detected”:
activate your venv first. maturin develop won’t install into the
system Python by design.