Skip to content

Latest commit

 

History

History
143 lines (98 loc) · 2.93 KB

File metadata and controls

143 lines (98 loc) · 2.93 KB

MRCpy Installation Guide

Quick Start (Recommended)

Option 1: Install with pip (from source)

cd main
pip install -e .

This installs the core package with all essential dependencies.

Option 2: Install with PyTorch support

cd main
pip install -e ".[pytorch]"

Option 3: Install with all optional features

cd main
pip install -e ".[all]"

Installation Options

The package supports several installation extras:

  • pytorch: PyTorch MGCE classifier support
  • lmrc: 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]"

Alternative: Manual Installation

If you prefer to install dependencies manually:

Minimal Installation

For core MRCpy functionality:

pip install -r requirements-minimal.txt

PyTorch MGCE Classifier

For the PyTorch-based MGCE classifier with GPU support:

pip install -r requirements-pytorch.txt

Full Installation

For all features (may require additional setup):

pip install -r requirements.txt
pip install -r requirements-optional.txt

Troubleshooting

pycddlib Installation Issues

pycddlib requires compilation and may fail on some systems. If you encounter issues:

  1. macOS: Install with Homebrew first

    brew install cddlib
    pip install pycddlib
  2. Linux: Install development packages

    sudo apt-get install libgmp-dev
    pip install pycddlib
  3. Skip if not needed: LMRC is the only classifier that requires pycddlib

Commercial Solvers (mosek, gurobipy)

These require licenses and should be installed separately:

libsvm Issues

If libsvm installation fails, you can use the official package:

pip install libsvm-official

Verifying Installation

Test 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)")

Recommended Installation Order

  1. Start minimal: pip install -r requirements-minimal.txt
  2. Add PyTorch (if needed): pip install -r requirements-pytorch.txt
  3. Add optional (if needed): Install specific packages from requirements-optional.txt

This approach avoids installation failures from optional dependencies.