cd main
pip install -e .This installs the core package with all essential dependencies.
cd main
pip install -e ".[pytorch]"cd main
pip install -e ".[all]"The package supports several installation extras:
pytorch: PyTorch MGCE classifier supportlmrc: LMRC classifier (requires pycddlib)solvers: Commercial solvers (Gurobi, Mosek)all: All optional dependencies
Examples:
# Just PyTorch
pip install -e ".[pytorch]"
# PyTorch + LMRC
pip install -e ".[pytorch,lmrc]"
# Everything
pip install -e ".[all]"If you prefer to install dependencies manually:
For core MRCpy functionality:
pip install -r requirements-minimal.txtFor the PyTorch-based MGCE classifier with GPU support:
pip install -r requirements-pytorch.txtFor all features (may require additional setup):
pip install -r requirements.txt
pip install -r requirements-optional.txtpycddlib requires compilation and may fail on some systems. If you encounter issues:
-
macOS: Install with Homebrew first
brew install cddlib pip install pycddlib
-
Linux: Install development packages
sudo apt-get install libgmp-dev pip install pycddlib
-
Skip if not needed: LMRC is the only classifier that requires pycddlib
These require licenses and should be installed separately:
- Mosek: Get academic license at https://www.mosek.com/products/academic-licenses/
- Gurobi: Get academic license at https://www.gurobi.com/academia/
If libsvm installation fails, you can use the official package:
pip install libsvm-officialTest your installation:
# Test core functionality
from MRCpy import MRC
print("✓ Core MRCpy installed")
# Test PyTorch MGCE
try:
from MRCpy.pytorch import mgce_clf
print("✓ PyTorch MGCE installed")
except ImportError:
print("✗ PyTorch MGCE not available")
# Test optional features
try:
from MRCpy import LMRC
print("✓ LMRC available (pycddlib installed)")
except (ImportError, AttributeError):
print("✗ LMRC not available (pycddlib not installed)")- Start minimal:
pip install -r requirements-minimal.txt - Add PyTorch (if needed):
pip install -r requirements-pytorch.txt - Add optional (if needed): Install specific packages from requirements-optional.txt
This approach avoids installation failures from optional dependencies.