Installation¶
Build and install Pysic-rs on macOS, Linux, or Windows. Two options: an editable development install (for active development) or a wheel build (for distribution).
Requirements¶
Tool |
Version |
Notes |
|---|---|---|
Rust toolchain |
≥ 1.70 |
|
Python |
≥ 3.8 |
3.11 recommended ( |
pip |
≥ 22 |
— |
maturin |
≥ 1.0 |
|
Install from source (recommended path)¶
git clone https://github.com/ThotDjehuty/pysic-rs.git
cd pysic-rs
# create/activate a virtual environment
python -m venv .venv && source .venv/bin/activate # macOS/Linux
pip install maturin
maturin develop --release
Verify:
import pysicrs
print(pysicrs.constants()["G"]) # 6.674e-11 m³ kg⁻¹ s⁻²
Build a Python wheel¶
maturin build --release
ls target/wheels/
Install the resulting wheel:
pip install target/wheels/pysic_rs-0.1.0-*.whl
Cargo features¶
Feature |
Description |
Default |
|---|---|---|
|
Build the PyO3 bindings (automatically on with maturin) |
no |
|
Enable Rayon parallelism in hot loops |
no |
maturin develop --release --features parallel
Troubleshooting¶
maturin not found
pip install --upgrade maturin
Linker / toolchain errors on macOS
xcode-select --install # if Command Line Tools are missing
rustup update stable
Import fails with ModuleNotFoundError: pysicrs._core
Rebuild the extension — the source module is Rust, so it must be compiled:
maturin develop --release
Slow release builds on first run
The first --release build compiles all dependencies from source; subsequent builds are
cached by cargo.
Optional interop: Optimiz-rs (statistics)¶
For probabilistic/statistical backgrounds, Pysic-rs integrates with Optimiz-rs (MCMC, HMM, SDE, Kalman filters). The two libraries are designed to be used side by side from the same Python environment:
pip install maturin
maturin develop --release # optimiz-rs
maturin develop --release # pysic-rs (in its own checkout)