Installation

Linux

The simplest way to install the package on a recent Debian-based system with Python 3 is:

sudo apt install python3-dev
pip3 install qpsolvers

You can add the --user parameter for a user-only installation.

If you have an older system with Python 2, for instance Ubuntu 16.04, try:

sudo apt install python-dev
pip install -r requirements2.txt

Python 2 is not supported any more, but this may still work.

Windows

  • First, install the Visual C++ Build Tools

  • Install your Python environment, for instance Anaconda

  • Open a terminal configured for Python, for instance from the Anaconda Navigator, and run:

pip install qpsolvers

Solvers

Open source solvers

To install at once all QP solvers available from the Python Package Index, run the pip command with the optional all_pypi_solvers dependency:

pip3 install "qpsolvers[all_pypi_solvers]"

This may take a while.

Gurobi

Gurobi comes with a one-line pip installation where you can fetch the solver directly from the company servers:

python -m pip install -i https://pypi.gurobi.com gurobipy

This version comes with limitations. For instance, trying to solve a problem with 200 optimization variables fails with the following warning:

Warning: Model too large for size-limited license; visit https://www.gurobi.com/free-trial for a full license

qpOASES

Check out the official qpOASES installation page for the latest release. However, you might run into errors at the make python step. If so, you can check out qpOASES from this fork and follow these instructions:

git clone --recursive https://github.com/stephane-caron/qpOASES.git
cd qpOASES
make
cd interfaces/python
python setup.py install --user

The setup.py script takes the same command-line arguments as pip. Remove –user and run it as root to install the library system-wide.