CBC MILP Solver

raw JSON →
2.929 verified Fri May 01 auth: no python

Binary distribution of the COIN-OR Branch and Cut (CBC) MILP solver for Python. Provides a precompiled CBC binary via Python package, enabling mixed-integer linear programming. Current version 2.929. Release cadence is irregular; follows upstream CBC releases.

pip install cbcbox
error ModuleNotFoundError: No module named 'cbcbox'
cause Package not installed or installed in a different environment.
fix
Run pip install cbcbox in the correct Python environment.
error FileNotFoundError: [Errno 2] No such file or directory: '.../cbc'
cause CBC binary missing due to incomplete installation or wrong platform.
fix
Ensure you are on a supported platform (Linux x86_64, macOS x86_64). For others, install CBC via conda or compile from source.
error PermissionError: [Errno 13] Permission denied: '.../cbc'
cause Binary lacks execute permission on Linux/macOS.
fix
Run import subprocess; subprocess.run(['chmod', '+x', str(cbc_path)]) after importing cbcbox.
deprecated Some OS-specific wheels are not updated; Linux x86_64 and macOS x86_64 are supported, but ARM macOS may see delays.
fix Use the conda-forge version of CBC or compile from source if your platform lacks a wheel.
gotcha The binary may not have execute permissions after installation on some systems; you may need to chmod +x.
fix Run: import subprocess; subprocess.run(['chmod', '+x', cbc_path])
breaking Version numbering changed between major releases; do not rely on version comparisons.
fix Check for the existence of the binary rather than pinning a specific version.
gotcha cbcbox does not expose a Python API; it only bundles the binary. Use PuLP or or-tools to actually solve models.
fix Install a modeling library like PuLP: `pip install pulp` and then set solver path to cbcbox's CBC binary.

Verifies that the CBC binary shipped with cbcbox exists. Then use with PuLP or or-tools by specifying the solver path.

import cbcbox
from pathlib import Path
cbc_path = Path(cbcbox.__file__).parent / 'cbc'
print('CBC executable found at:', cbc_path.exists())