Skip to main content

Constrained Optimization BY Quadratic Approximations

Project description

COBYQA, an acronym for Constrained Optimization BY Quadratic Approximations, is designed to supersede COBYLA as a general derivative-free optimization solver. It can handle unconstrained, bound-constrained, linearly constrained, and nonlinearly constrained problems. It uses only function values of the objective and constraint functions, if any. No derivative information is needed.



COBYQA can be installed for Python 3.8 or above.


The following Python packages are required by COBYQA:

  • NumPy 1.17.0 or higher, and

  • SciPy 1.10.0 or higher.

If you install COBYQA using pip or conda (see below), these dependencies will be installed automatically. More dependencies are required to run the test suite and some examples given in the folder examples. See the relevant sections below for more details.

User installation

The easiest way to install COBYQA is using pip or conda. To install it using pip, run in a terminal or command window

pip install cobyqa

If you are using conda, you can install COBYQA from the conda-forge channel by running

conda install conda-forge::cobyqa

To check your installation, you can execute

python -c "import cobyqa; cobyqa.show_versions()"

If your python launcher is not python, you can replace it with the appropriate command (similarly for pip and conda). For example, you may need to use python3 instead of python and pip3 instead of pip.


To execute the test suite of COBYQA, you first need to install pytest. You can then run the test suite by executing

pytest --pyargs cobyqa

The test suite takes several minutes to run. It is unnecessary to run the test suite if you installed COBYQA using the recommended method described above.


The folder examples contains a few examples of how to use COBYQA. To run, you first need to install matplotlib. These files contains headers explaining what problems they solve.


To report a bug or request a new feature, please open a new issue using the issue tracker.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cobyqa-1.1.1.tar.gz (57.0 kB view hashes)

Uploaded Source

Built Distribution

cobyqa-1.1.1-py3-none-any.whl (56.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page