网页
综合
更新时间 2026-11-14 05:26:47
Install -
自动蜘蛛
www.cvxpy.org
正文约 4530 字
⏱️ Help us benchmark CVXPY solvers! Contribute problems and results to the Solver Benchmarks project. Read our new paper on the CVXPY internals!
CVXPY supports Python 3 on Linux, macOS, and Windows. You can use pip or conda for installation. You may want to isolate your installation in a virtualenv, or a conda environment.
(Windows only) Download the Visual Studio build tools for Python 3 (instructions).
(macOS only) Install the Xcode command line tools.
(optional) Create and activate a virtual environment.
Install CVXPY using pip:
You can add solver names as “extras”; pip will then install the necessary additional Python packages.
conda is a system for package and environment management.
(Windows only) Download the Visual Studio build tools for Python 3.
2. Create a new conda environment,
or activate an existing one
3. Install cvxpy from conda-forge
We strongly recommend using a fresh virtual environment (virtualenv or conda) when installing CVXPY from source.
CVXPY has the following dependencies:
All required packages are installed automatically alongside CVXPY.
Perform the following steps to install CVXPY from source:
Clone the official CVXPY git repository, or a newly minted fork of the CVXPY repository.
Navigate to the top-level of the cloned directory.
3. If you want to use CVXPY with editable source code, run
We provide support for GitHub Codespaces with preconfigured environments for CVXPY development via devcontainers. To get started, click the “Code” button on the CVXPY repository and select “Open with Codespaces”.
CVXPY supports the CVXOPT solver. Additionally, through CVXOPT, CVXPY supports the GLPK solver. On most platforms, CVXOPT comes with GLPK bundled. On such platforms, installing CVXOPT with
should suffice to get support for both CVXOPT and GLPK.
On other platforms, to install CVXPY and its dependencies with GLPK support, follow these instructions:
Install GLPK. We recommend either installing the latest GLPK from source or using a package manager such as apt-get on Ubuntu and homebrew on OS X.
Install CVXOPT with GLPK bindings.
Follow the standard installation procedure to install CVXPY and its remaining dependencies.
CVXPY supports the GUROBI solver. Install GUROBI version 9.5 or greater such that you can import gurobipy in Python. See the GUROBI website for installation instructions.
CVXPY supports the Moreau solver, a GPU-accelerated conic optimization solver. Contact Optimal Intellect for installation instructions and system requirements.
CVXPY supports the MOSEK solver. Simply install MOSEK such that you can import mosek in Python. See the MOSEK website for installation instructions.
CVXPY supports the MPAX solver. Simply install MPAX such that you can import mpax in Python. See the MPAX website for installation instructions. In addition, please refer to the JAX installation instructions to install JAX.
CuClarabel is currently only available in the Julia version of Clarabel. To install CuClarabel, install Julia, and then run in a julia terminal Pkg.add(Pkg.PackageSpec(url="https://github.com/oxfordcontrol/Clarabel.jl.git", rev="CuClarabel")).
Then install cupy and juliacall such that you can import cupy and import juliacall in Python.
CVXPY supports the FICO Xpress solver. Simply install XPRESS such that you can import xpress in Python. See the Xpress Python documentation pages for installation instructions.
CVXPY supports the Cbc solver (which includes Clp and Cgl) with the help of cylp. Simply install cylp and the corresponding prerequisites according to the instructions, such you can import this library in Python.
CVXPY supports the COPT solver. Simply install COPT such that you can import coptpy in Python. See the COPT release page for installation instructions.
CVXPY supports the CPLEX solver. Simply install CPLEX such that you can import cplex in Python. See the CPLEX website for installation instructions.
CVXPY supports the SDPA solver. Simply install SDPA for Python such that you can import sdpap in Python. See the SDPA for Python website for installation instructions.
The sdpt3glue package allows you to model problems with CVXPY and solve them with SDPT3.
CVXPY supports the NAG solver. Simply install NAG such that you can import naginterfaces in Python. See the NAG website for installation instructions.
CVXPY supports the GLOP and PDLP solvers. Both solvers are provided by the open source OR-Tools package. Install OR-Tools such that you can run import ortools in Python. OR-Tools version 9.3 or greater is required.
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。