--- id: ecos version: "2.0.14" license: GPLv3 license_treatment: copyleft maintenance: dormant --- # ecos — This is the Python package for ECOS: Embedded Cone Solver. See Github page for more information. License: copyleft · Maintenance: dormant · Downloads: 1.1M/mo ## What it is and what it does ECOS is a numerical solver for convex optimization problems expressed as second-order cone programs. It accepts a cost vector, linear equality and inequality constraints (including generalized cone constraints), and returns the optimal primal and dual solutions along with solver diagnostics. The solver supports both continuous and mixed-integer variants via branch-and-bound. You use ECOS by calling its solve() function with numpy arrays for the cost and constraint data, scipy sparse matrices for constraint coefficients, and a dictionary specifying cone dimensions. It is commonly used as a backend solver in CVXPY, a high-level convex optimization modeling framework, but can also be called directly for lower-level control. Dependencies are numpy and scipy. Use it for: - Solve portfolio optimization problems with risk constraints modeled as second-order cones. - Embedded control systems where a convex problem must be solved repeatedly with tight computational budgets. - Mixed-integer convex problems via branch-and-bound with configurable tolerances and iteration limits. - Backend solver for CVXPY when you need direct access to primal and dual solutions and solver statistics. - Research and prototyping of convex optimization algorithms that require a reliable reference implementation. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. ECOS is a Python wrapper for a numerical solver that handles convex second-order cone programs (SOCPs), accepting linear and cone constraints and returning optimal solutions. Yes, if you need to solve convex second-order cone programs and are comfortable with GPLv3 licensing. The solver is numerically mature, has no known vulnerabilities, and offers pre-built wheels for common platforms. Install friction is moderate but manageable. The dormant maintenance status is not a blocker for stable use, but flag it if you anticipate needing active support or bug fixes. ## Install pip install ecos uv add ecos poetry add ecos ## Installing ecos Before you install: Medium install friction due to compiled C dependencies, but pre-built wheels are available for multiple Python versions on macOS, Linux, and Windows. The package is dormant (no release in 787 days), though the underlying solver is stable and the repository remains active. License in practice: ECOS is licensed under GPLv3 (copyleft), meaning any derivative work or linked application must also be open-source under a compatible license. Commercial use or proprietary integration requires explicit permission from embotech. Quickstart: import numpy as np import scipy.sparse as sp import ecos # Solve: min c'x s.t. Ax=b, Gx <=_K h c = np.array([1.0, -1.0]) A = sp.csr_matrix([[1.0, 1.0]]) b = np.array([1.0]) G = sp.csr_matrix([[-1.0, 0.0], [0.0, -1.0]]) h = np.array([0.0, 0.0]) dims = {'l': 2, 'q': []} solution = ecos.solve(c, G, h, dims, A, b) print(solution['x']) Requires numpy and scipy. If building from source, you need a C compiler and the development headers for numpy and scipy. Verify before relying: - Whether the solver supports warm-starting from a previous solution - Performance characteristics on large-scale problems (problem size limits or typical solve times) - Current maintenance roadmap and likelihood of future updates beyond the last commit on 2024-06-10 ## Package facts - License: GPLv3 (copyleft) - Python support: unspecified - Install friction: medium - Maintenance: dormant - Downloads: 1.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags convex optimization solver, second-order cone programming, SOCP solver python, conic programming, embedded cone solver, convex problem solver, convex-optimization, numerical-solver, conic-programming [View on SkillFed](https://skillfed.io/packages/ecos) · [View on PyPI](https://pypi.org/project/ecos/)