Installation Guide¶
Requirements¶
Python 3.8 or higher
Rust 1.70 or higher (for building from source)
pip
Install from PyPI¶
Coming soon: Optimiz-rs will be available on PyPI.
pip install optimizr
Install from Source¶
Step 1: Clone Repository¶
git clone https://github.com/ThotDjehuty/optimiz-r.git
cd optimiz-r
Step 2: Install Maturin¶
Maturin is required to build Rust-Python bindings:
pip install maturin
Step 3: Build and Install¶
Development mode (editable install, useful for development):
maturin develop --release
Production install (creates wheel and installs):
maturin build --release
pip install target/wheels/optimizr-*.whl
Step 4: Verify Installation¶
import optimizr
print(optimizr.__version__) # Should print "0.3.0"
Platform-Specific Notes¶
macOS¶
If you encounter build errors on macOS:
Ensure Xcode Command Line Tools are installed:
xcode-select --installInstall Rust via rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Windows¶
Install Visual Studio Build Tools (2019 or later)
Install Rust via rustup-init.exe
Follow standard installation steps
Linux¶
Requires GCC or Clang:
# Ubuntu/Debian
sudo apt-get install build-essential
# If you see OpenBLAS link errors during wheels/docs build
sudo apt-get install libopenblas-dev
# Fedora/RHEL
sudo dnf install gcc gcc-c++
Troubleshooting¶
Issue: maturin: command not found
Solution: Ensure pip bin directory is in PATH:
export PATH="$HOME/.local/bin:$PATH" # Linux/macOS
Issue: Rust compiler errors
Solution: Update Rust to latest stable:
rustup update stable
Issue: ImportError when importing optimizr
Solution: Rebuild with correct Python version:
maturin develop --release -i python3.10 # Replace with your Python version
Issue: BLAS/LAPACK linkage errors on Linux
Solution: Install OpenBLAS headers (see Linux section above) and rebuild with maturin develop --release.