Getting Started#
This guide will provide you with the necessary steps to get started with Linopy, from installation to creating your first model and beyond.
Before you start, make sure you have the following:
Python 3.9 or later installed on your system.
Basic knowledge of Python and linear programming.
Install Linopy#
You can install Linopy using pip or conda. Here are the commands for each method:
pip install linopy
or
conda install -c conda-forge linopy
Install a solver#
Linopy won’t work without a solver. Currently, the following solvers are supported:
CPU-based solvers#
Cbc - open source, free, fast
GLPK - open source, free, not very fast
HiGHS - open source, free, fast
Gurobi - closed source, commercial, very fast
Xpress - closed source, commercial, very fast (GPU acceleration available in v9.8+)
Cplex - closed source, commercial, very fast
MindOpt -
COPT - closed source, commercial, very fast
For a subset of the solvers, Linopy provides a wrapper.
pip install linopy[solvers]
We recommend to install the HiGHS solver if possible, which is free and open source but not yet available on all platforms.
pip install highspy
GPU-accelerated solvers#
For large-scale optimization problems, GPU-accelerated solvers can provide significant performance improvements:
cuPDLPx - open source, GPU-accelerated first-order solver
Note: GPU solvers require compatible NVIDIA GPU hardware and CUDA installation. See the GPU-Accelerated Solving guide for detailed setup instructions.
pip install cupdlpx
For most of the other solvers, please click on the links to get further installation information.
If you’re ready, let’s dive in!