ecos
This is the Python package for ECOS: Embedded Cone Solver. See Github page for more information.
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 on this page — 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
ecos on PyPI
pip
pip install ecosuv
uv add ecospoetry
poetry add ecosInstalling 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 | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 2 — numpy, scipy |
| Maintenance | dormant — 787 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,120,550/month — #4,339 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ecos-2.0.14-cp310-cp310-macosx_10_9_x86_64.whl; ecos-2.0.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; ecos-2.0.14-cp310-cp310-win_amd64.whl; ecos-2.0.14-cp311-cp311-macosx_10_9_x86_64.whl; ecos-2.0.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; ecos-2.0.14-cp311-cp311-win_amd64.whl; ecos-2.0.14-cp312-cp312-macosx_10_9_x86_64.whl; ecos-2.0.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; ecos-2.0.14-cp312-cp312-win_amd64.whl; ecos-2.0.14-cp37-cp37m-macosx_10_9_x86_64.whl; ecos-2.0.14-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; ecos-2.0.14-cp37-cp37m-win_amd64.whl; ecos-2.0.14-cp38-cp38-macosx_10_9_x86_64.whl; ecos-2.0.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; ecos-2.0.14-cp38-cp38-win_amd64.whl; ecos-2.0.14-cp39-cp39-macosx_10_9_x86_64.whl; ecos-2.0.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; ecos-2.0.14-cp39-cp39-win_amd64.whl
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
clarabelClarabel is an interior-point conic…
permissive · top 5,000 on PyPI
scsscs is a Python interface to the Splitting…
permissive · top 5,000 on PyPI
MosekMOSEK solves large-scale convex and…
unclear · top 15,000 on PyPI
cvxpyCVXPY is a Python modeling language for…
permissive · top 5,000 on PyPI
ropwrRoPWR computes optimal piecewise polynomial…
permissive · top 15,000 on PyPI
qpsolversProvides a unified Python interface to solve…
copyleft · top 5,000 on PyPI
cvxoptcvxopt is a Python library for solving convex…
unclear · top 5,000 on PyPI
osqpOSQP is a Python wrapper for the Operator…
permissive · top 5,000 on PyPI
cvxpy-basecvxpy-base provides compiled solver kernels for…
permissive · top 15,000 on PyPI
quadprogSolves strictly convex quadratic programming…
copyleft · top 15,000 on PyPI