--- id: cvxpy version: "1.9.2" license: Apache-2.0 license_treatment: permissive maintenance: active --- # cvxpy — A domain-specific language for modeling convex optimization problems in Python. License: permissive · Maintenance: active · Downloads: 5.1M/mo ## What it is and what it does CVXPY is a domain-specific language embedded in Python that lets you write convex optimization problems in mathematical notation rather than solver-specific standard form. You define variables, an objective function, and constraints using CVXPY's API, then call solve() to delegate to one of several open-source solvers (Clarabel, SCS, OSQP, HiGHS). It handles the translation and returns optimal values and dual variables. The package supports a broad range of problem classes: convex optimization (the primary use case), mixed-integer convex problems, geometric programs, quasiconvex programs, and nonlinear programs. It relies on 8 runtime dependencies—numerical libraries (numpy, scipy, sparsediffpy) and solver backends (osqp, clarabel, scs, highspy, qdldl)—all of which install together. The project is actively maintained, has been in development since 2014, and is widely used in research and industry. Use it for: - Solve least-squares problems with variable bounds, as shown in the documentation example. - Formulate and solve portfolio optimization problems with convex constraints. - Model resource allocation and scheduling problems as convex or mixed-integer programs. - Prototype control and signal processing algorithms that rely on convex optimization. - Solve geometric programming problems for engineering design and optimization. - Develop machine learning models that incorporate convex loss functions and regularization. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. CVXPY is a Python modeling language for expressing and solving convex optimization problems, mixed-integer convex problems, geometric programs, quasiconvex programs, and nonlinear programs using open-source solvers. Yes. CVXPY is a mature, actively maintained package (latest release 53 days ago, 6299 GitHub stars) with permissive Apache-2.0 licensing, no known vulnerabilities, and broad solver support. Medium install friction is justified by the complexity of the underlying solvers. Install it if you need to model and solve convex or mixed-integer optimization problems in Python without writing solver-specific code. ## Install pip install cvxpy uv add cvxpy poetry add cvxpy ## Installing cvxpy Before you install: Medium install friction due to 8 runtime dependencies including compiled solvers (osqp, clarabel, scs, highspy, qdldl) and numerical libraries (numpy, scipy, sparsediffpy). Pre-built wheels available for modern Python versions (3.11–3.14) across macOS, Linux, and Windows. Active maintenance with a recent release 53 days ago. License in practice: Apache-2.0 permissive license allows commercial and private use with minimal restrictions; you may use, modify, and distribute CVXPY and derivative works freely provided you retain license and copyright notices. Quickstart: pip install cvxpy import cvxpy as cp import numpy x = cp.Variable(20) objective = cp.Minimize(cp.sum_squares(A @ x - b)) constraints = [0 <= x, x <= 1] prob = cp.Problem(objective, constraints) result = prob.solve() print(x.value) Requires Python >= 3.11. Solvers (osqp, clarabel, scs, highspy) must be installed as dependencies; additional solvers may require separate installation. Verify before relying: - Performance characteristics and scalability limits for large-scale problems are not specified in the fact sheet. - Solver selection strategy and how CVXPY chooses among available solvers (osqp, clarabel, scs, highspy) is not detailed. - Whether all 8 runtime dependencies are mandatory or if some are optional for specific use cases. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 5.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags convex optimization modeling, mathematical optimization python, linear programming solver, quadratic programming, constraint optimization problems, cvxpy solver interface, optimization modeling language, optimization, convex-programming, mathematical-modeling [View on SkillFed](https://skillfed.io/packages/cvxpy) · [View on PyPI](https://pypi.org/project/cvxpy/)