Registry / data / cylp
library0.94.0pypypi✓ verified 85d ago

CyLP is a Python interface for the COIN-OR Linear Programming (CLP), COIN-OR Branch and Cut (CBC), and COIN-OR Cut Generation Library (CGL) solvers. It provides a modeling layer similar to PuLP but directly wraps the COIN-OR solvers for efficient linear and mixed-integer programming. Version 0.94.0 is current; release cadence is intermittent.

pip install cylp
INSTALL
IMPORT
SIG · CYLP
C
cylp
datapythonv0.94.0
Install
7.9s avg
Import
1056ms
Disk
259MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.94.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 7.9s · import 1.056s · 255MB
259MB installed
● package 259MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CyClpSimplex
from cylp.cy import CyClpSimplex
from cylp import CyClpSimplex
CyClpSimplex is in the cy submodule, not top-level cylp.
CbcModel
from cylp.cy import CbcModel
from cylp import CbcModel
Same as above, CbcModel is in cylp.cy.

Standard quickstart: define a CyLP model, create a CyClpSimplex solver, solve, and print solution.

from cylp.cy import CyClpSimplex from cylp.py.modeling.CyLPModel import CyLPModel, CyLPArray model = CyLPModel() x = model.addVariable('x', 1) y = model.addVariable('y', 1) model += 2*x + 3*y <= 10 model += x - y >= 1 model.objective = x + 2*y solver = CyClpSimplex() solver.setModel(model) solver.primal() print('x =', solver.primalVariableSolution['x']) print('y =', solver.primalVariableSolution['y'])
Debug
Known issues
deprecatedThe 'cylp.py.modeling.CyLPModel' approach is older; newer examples use 'CyClpSimplex' directly with matrix input. The modeling module may see less development.
fix
For new code, consider using CyClpSimplex.addColumn/addRow methods or switch to a more actively maintained package like PuLP if needed.
affects: 0.94.0
gotchaInstallation from source requires Cython, NumPy, and a compatible C++ compiler. Pre-built wheels may not be available for all platforms (e.g., Python 3.11+ or ARM).
fix
Use 'pip install cylp' and if it fails, ensure build dependencies are installed. Check PyPI for wheel availability.
affects: all
breakingIn versions prior to 0.90, the import path was 'cylp.CyClpSimplex' not 'cylp.cy.CyClpSimplex'. Code written for old versions will break.
fix
Update imports: change 'from cylp import CyClpSimplex' to 'from cylp.cy import CyClpSimplex'.
affects: <0.90
gotchaThe CyLP modeling layer (CyLPModel) uses 1-indexed variable IDs internally. Supplying 0-based indices may cause silent errors.
fix
Always use 1-based indexing when referring to variable IDs in lower-level API calls.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'CyClpSimplex' from 'cylp'
Commonly occurs when using the wrong import path; CyClpSimplex is in the cylp.cy submodule.
fix
Use 'from cylp.cy import CyClpSimplex' instead of 'from cylp import CyClpSimplex'.
AttributeError: 'CyClpSimplex' object has no attribute 'primalVariableSolution'
This attribute exists only after solving with a model set via setModel. If solving directly with matrix input, use getColSolution/getRowPrice instead.
fix
After calling solver.primal(), access solution via solver.primalVariableSolution if using CyLPModel; otherwise use solver.getColSolution().
RuntimeError: CoinAssert or incorrect argument
Often caused by passing invalid column indices (0-based) when API expects 1-based indices.
fix
Ensure column/row indices start from 1, not 0. For example, in addColumn, the column numbers are 1-indexed.
Upgrade
Version history
0.94.0latest on PyPI · released Dec 3, 2025
Audit
Dependencies
numpyrequiredrequired for data structures and matrix operations
cythonoptionalrequired to compile the C extensions from source
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
cylp — pip install cylp · libregistry