cvxpy 1.7.3


pip install cvxpy

  Latest version

Released: Sep 22, 2025

Project Links

Meta
Author: Steven Diamond, , Eric Chu, Stephen Boyd
Requires Python: >=3.9

Classifiers

CVXPY

Build Status PyPI - downloads Conda - downloads Discord Coverage Benchmarks OpenSSF Scorecard

The CVXPY documentation is at cvxpy.org.

We are building a CVXPY community on Discord. Join the conversation! For issues and long-form discussions, use Github Issues and Github Discussions.

Contents

CVXPY is a Python-embedded modeling language for convex optimization problems. It allows you to express your problem in a natural way that follows the math, rather than in the restrictive standard form required by solvers.

For example, the following code solves a least-squares problem where the variable is constrained by lower and upper bounds:

import cvxpy as cp
import numpy

# Problem data.
m = 30
n = 20
numpy.random.seed(1)
A = numpy.random.randn(m, n)
b = numpy.random.randn(m)

# Construct the problem.
x = cp.Variable(n)
objective = cp.Minimize(cp.sum_squares(A @ x - b))
constraints = [0 <= x, x <= 1]
prob = cp.Problem(objective, constraints)

# The optimal objective is returned by prob.solve().
result = prob.solve()
# The optimal value for x is stored in x.value.
print(x.value)
# The optimal Lagrange multiplier for a constraint
# is stored in constraint.dual_value.
print(constraints[0].dual_value)

With CVXPY, you can model

  • convex optimization problems,
  • mixed-integer convex optimization problems,
  • geometric programs, and
  • quasiconvex programs.

CVXPY is not a solver. It relies upon the open source solvers Clarabel, SCS, and OSQP. Additional solvers are available, but must be installed separately.

CVXPY began as a Stanford University research project. It is now developed by many people, across many institutions and countries.

Installation

CVXPY is available on PyPI, and can be installed with

pip install cvxpy

CVXPY can also be installed with conda, using

conda install -c conda-forge cvxpy

CVXPY has the following dependencies:

  • Python >= 3.9
  • Clarabel >= 0.5.0
  • OSQP >= 0.6.2
  • SCS >= 3.2.4.post1
  • NumPy >= 1.22.4
  • SciPy >= 1.13.0

For detailed instructions, see the installation guide.

Getting started

To get started with CVXPY, check out the following:

Issues

We encourage you to report issues using the Github tracker. We welcome all kinds of issues, especially those related to correctness, documentation, performance, and feature requests.

For basic usage questions (e.g., "Why isn't my problem DCP?"), please use StackOverflow instead.

Community

The CVXPY community consists of researchers, data scientists, software engineers, and students from all over the world. We welcome you to join us!

  • To chat with the CVXPY community in real-time, join us on Discord.
  • To have longer, in-depth discussions with the CVXPY community, use Github Discussions.
  • To share feature requests and bug reports, use Github Issues.

Please be respectful in your communications with the CVXPY community, and make sure to abide by our code of conduct.

Contributing

We appreciate all contributions. You don't need to be an expert in convex optimization to help out.

You should first install CVXPY from source. Here are some simple ways to start contributing immediately:

If you'd like to add a new example to our library, or implement a new feature, please get in touch with us first to make sure that your priorities align with ours.

Contributions should be submitted as pull requests. A member of the CVXPY development team will review the pull request and guide you through the contributing process.

Before starting work on your contribution, please read the contributing guide.

Team

CVXPY is a community project, built from the contributions of many researchers and engineers.

CVXPY is developed and maintained by Steven Diamond, Akshay Agrawal, Riley Murray, Philipp Schiele, Bartolomeo Stellato, and Parth Nobel, with many others contributing significantly. A non-exhaustive list of people who have shaped CVXPY over the years includes Stephen Boyd, Eric Chu, Robin Verschueren, Jaehyun Park, Enzo Busseti, AJ Friend, Judson Wilson, Chris Dembia, and William Zhang.

For more information about the team and our processes, see our governance document.

Citing

If you use CVXPY for academic work, we encourage you to cite our papers. If you use CVXPY in industry, we'd love to hear from you as well, on Discord or over email.

1.7.3 Sep 22, 2025
1.7.2 Aug 24, 2025
1.7.1 Jul 18, 2025
1.7.0 Jul 14, 2025
1.6.7 Jul 14, 2025
1.6.6 Jun 10, 2025
1.6.5 Apr 13, 2025
1.6.4 Mar 16, 2025
1.6.3 Mar 09, 2025
1.6.2 Feb 26, 2025
1.6.1 Feb 20, 2025
1.6.0 Nov 11, 2024
1.5.4 Nov 14, 2024
1.5.3 Aug 18, 2024
1.5.2 Jun 18, 2024
1.5.1 May 11, 2024
1.5.0 May 09, 2024
1.4.4 May 10, 2024
1.4.3 Apr 16, 2024
1.4.2 Jan 19, 2024
1.4.1 Oct 12, 2023
1.4.0 Oct 09, 2023
1.3.4 Apr 19, 2024
1.3.3 Jan 22, 2024
1.3.2 Jun 27, 2023
1.3.1 Mar 18, 2023
1.3.0 Jan 03, 2023
1.2.5 Aug 08, 2023
1.2.4 Mar 23, 2023
1.2.3 Dec 27, 2022
1.2.2 Nov 04, 2022
1.2.1 May 16, 2022
1.2.0 Mar 09, 2022
1.1.24 Aug 09, 2023
1.1.23 Mar 23, 2023
1.1.22 Dec 27, 2022
1.1.21 Nov 04, 2022
1.1.20 May 16, 2022
1.1.19 Mar 09, 2022
1.1.18 Dec 28, 2021
1.1.17 Nov 03, 2021
1.1.16 Nov 03, 2021
1.1.15 Aug 13, 2021
1.1.14 Jul 24, 2021
1.1.13 May 24, 2021
1.1.12 Apr 07, 2021
1.1.11 Mar 05, 2021
1.1.10 Feb 07, 2021
1.1.9 Feb 06, 2021
1.1.8 Feb 03, 2021
1.1.7 Oct 22, 2020
1.1.6 Oct 07, 2020
1.1.5 Aug 27, 2020
1.1.4 Aug 14, 2020
1.1.3 Jul 14, 2020
1.1.2 Jul 14, 2020
1.1.1 Jun 03, 2020
1.1.0 Jun 02, 2020
1.1.0a4 Apr 26, 2020
1.1.0a3 Feb 07, 2020
1.1.0a2 Jan 06, 2020
1.1.0a1 Oct 30, 2019
1.1.0a0 Oct 18, 2019
1.0.31 Apr 09, 2020
1.0.29 Apr 01, 2020
1.0.28 Feb 24, 2020
1.0.27 Feb 24, 2020
1.0.26 Feb 21, 2020
1.0.25 Aug 21, 2019
1.0.24 May 31, 2019
1.0.23 May 20, 2019
1.0.22 May 12, 2019
1.0.21 Mar 07, 2019
1.0.20 Mar 07, 2019
1.0.19 Feb 28, 2019
1.0.18 Feb 21, 2019
1.0.17 Feb 21, 2019
1.0.16 Feb 20, 2019
1.0.15 Feb 13, 2019
1.0.14 Jan 24, 2019
1.0.13 Jan 23, 2019
1.0.12 Jan 15, 2019
1.0.11 Dec 14, 2018
1.0.10 Oct 16, 2018
1.0.9 Oct 04, 2018
1.0.8 Aug 22, 2018
1.0.6 Jun 11, 2018
1.0.5 Jun 09, 2018
1.0.4 Jun 08, 2018
1.0.3 May 17, 2018
1.0.2 May 17, 2018
0.4.11 Aug 22, 2017
0.4.10 May 08, 2017
0.4.9 Mar 13, 2017
0.4.8 Oct 29, 2016
0.4.6 Oct 19, 2016
0.4.5 Aug 31, 2016
0.4.4 Aug 25, 2016
0.4.3 Aug 09, 2016
0.4.2 Jun 19, 2016
0.4.1 Jun 05, 2016
0.4.0 Apr 26, 2016
0.3.9 Apr 05, 2016
0.3.8 Mar 03, 2016
0.3.7 Feb 08, 2016
0.3.6 Feb 02, 2016
0.3.5 Dec 25, 2015
0.3.4 Nov 14, 2015
0.3.3 Nov 07, 2015
0.3.1 Sep 30, 2015
0.3.0 Sep 15, 2015
0.2.28 Aug 30, 2015
0.2.27 Aug 26, 2015
0.2.26 Aug 22, 2015
0.2.25 Jul 15, 2015
0.2.24 Jun 22, 2015
0.2.23 Jun 10, 2015
0.2.22 Jun 03, 2015
0.2.21 May 18, 2015
0.2.20 Apr 29, 2015
0.2.19 Apr 23, 2015
0.2.18 Apr 23, 2015
0.2.17 Jan 28, 2015
0.2.16 Jan 05, 2015
0.2.15 Oct 18, 2014
0.2.14 Oct 06, 2014
0.2.13 Oct 02, 2014
0.2.12 Sep 04, 2014
0.2.11 Aug 28, 2014
0.2.10 Aug 13, 2014
0.2.9 Aug 10, 2014
0.2.7 Aug 06, 2014
0.2.6 Aug 01, 2014
0.2.5 Jul 14, 2014
0.2.4 Jul 08, 2014
0.2.3 Jul 07, 2014
0.2.2 Jul 02, 2014
0.2.1 Jun 05, 2014
0.2 May 13, 2014
0.1 May 05, 2014

Wheel compatibility matrix

Platform CPython 3.9 CPython 3.10 CPython 3.11 CPython 3.12 CPython 3.13
macosx_10_13_universal2
macosx_10_13_x86_64
macosx_10_9_universal2
macosx_10_9_x86_64
manylinux_2_24_aarch64
manylinux_2_24_x86_64
manylinux_2_28_aarch64
manylinux_2_28_x86_64
win_amd64

Files in release

cvxpy-1.7.3-cp310-cp310-macosx_10_9_universal2.whl (1.5MiB)
cvxpy-1.7.3-cp310-cp310-macosx_10_9_x86_64.whl (1.1MiB)
cvxpy-1.7.3-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (1.1MiB)
cvxpy-1.7.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (1.2MiB)
cvxpy-1.7.3-cp310-cp310-win_amd64.whl (1.1MiB)
cvxpy-1.7.3-cp311-cp311-macosx_10_9_universal2.whl (1.5MiB)
cvxpy-1.7.3-cp311-cp311-macosx_10_9_x86_64.whl (1.1MiB)
cvxpy-1.7.3-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (1.1MiB)
cvxpy-1.7.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (1.2MiB)
cvxpy-1.7.3-cp311-cp311-win_amd64.whl (1.1MiB)
cvxpy-1.7.3-cp312-cp312-macosx_10_13_universal2.whl (1.5MiB)
cvxpy-1.7.3-cp312-cp312-macosx_10_13_x86_64.whl (1.1MiB)
cvxpy-1.7.3-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (1.1MiB)
cvxpy-1.7.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (1.2MiB)
cvxpy-1.7.3-cp312-cp312-win_amd64.whl (1.1MiB)
cvxpy-1.7.3-cp313-cp313-macosx_10_13_universal2.whl (1.5MiB)
cvxpy-1.7.3-cp313-cp313-macosx_10_13_x86_64.whl (1.1MiB)
cvxpy-1.7.3-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (1.1MiB)
cvxpy-1.7.3-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (1.2MiB)
cvxpy-1.7.3-cp313-cp313-win_amd64.whl (1.1MiB)
cvxpy-1.7.3-cp39-cp39-macosx_10_9_universal2.whl (1.5MiB)
cvxpy-1.7.3-cp39-cp39-macosx_10_9_x86_64.whl (1.1MiB)
cvxpy-1.7.3-cp39-cp39-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (1.1MiB)
cvxpy-1.7.3-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (1.2MiB)
cvxpy-1.7.3-cp39-cp39-win_amd64.whl (1.1MiB)
cvxpy-1.7.3.tar.gz (1.6MiB)
Extras:
Dependencies:
osqp (>=1.0.0)
clarabel (>=0.5.0)
scs (>=3.2.4.post1)
numpy (>=1.22.4)
scipy (>=1.13.0)