Skip to main content

A flexible derivative-free solver for (bound constrained) general objective minimization

Project description

Py-BOBYQA: Derivative-Free Solver for Bound-Constrained Minimization

.. image::
:alt: Build Status

.. image::
:alt: GNU GPL v3 License

.. image::
:alt: Latest PyPI version

Py-BOBYQA is a flexible package for solving bound-constrained general objective minimization, without requiring derivatives of the objective. It is a Python implementation of the BOBYQA algorithm by Powell. Py-BOBYQA is particularly useful when evaluations of the objective function are expensive and/or noisy.

More details about Py-BOBYQA can be found in our papers:

1. Coralia Cartis, Jan Fiala, Benjamina Marteau and Lindon Roberts, `Improving the Flexibility and Robustness of Model-Based Derivative-Free Optimization Solvers <>`_, technical report, University of Oxford, (2018).
2. Coralia Cartis, Lindon Roberts and Oliver Sheridan-Methven, `Escaping local minima with derivative-free methods: a numerical investigation <>`_, technical report, University of Oxford, (2018).

Please cite [1] when using Py-BOBYQA for local optimization, and [1,2] when using Py-BOBYQA's global optimization heuristic functionality. For reproducibility of all figures, please feel free to contact the authors.

The original paper by Powell is: M. J. D. Powell, The BOBYQA algorithm for bound constrained optimization without derivatives, technical report DAMTP 2009/NA06, University of Cambridge (2009), and the original Fortran implementation is available `here <>`_.

If you are interested in solving least-squares minimization problems, you may wish to try `DFO-LS <>`_, which has the same features as Py-BOBYQA (plus some more), and exploits the least-squares problem structure, so performs better on such problems.

See manual.pdf or `here <>`_.

Py-BOBYQA requires the following software to be installed:

* Python 2.7 or Python 3 (

Additionally, the following python packages should be installed (these will be installed automatically if using *pip*, see `Installation using pip`_):

* NumPy 1.11 or higher (
* SciPy 0.18 or higher (
* Pandas 0.17 or higher (

Installation using pip
For easy installation, use `pip <>`_ as root:

.. code-block:: bash

$ [sudo] pip install Py-BOBYQA

or alternatively *easy_install*:

.. code-block:: bash

$ [sudo] easy_install Py-BOBYQA

If you do not have root privileges or you want to install Py-BOBYQA for your private use, you can use:

.. code-block:: bash

$ pip install --user Py-BOBYQA

which will install Py-BOBYQA in your home directory.

Note that if an older install of Py-BOBYQA is present on your system you can use:

.. code-block:: bash

$ [sudo] pip install --upgrade Py-BOBYQA

to upgrade Py-BOBYQA to the latest version.

Manual installation
Alternatively, you can download the source code from `Github <>`_ and unpack as follows:

.. code-block:: bash

$ git clone
$ cd pybobyqa

Py-BOBYQA is written in pure Python and requires no compilation. It can be installed using:

.. code-block:: bash

$ [sudo] pip install .

If you do not have root privileges or you want to install Py-BOBYQA for your private use, you can use:

.. code-block:: bash

$ pip install --user .


To upgrade Py-BOBYQA to the latest version, navigate to the top-level directory (i.e. the one containing :code:``) and rerun the installation using :code:`pip`, as above:

.. code-block:: bash

$ git pull
$ [sudo] pip install . # with admin privileges

If you installed Py-BOBYQA manually, you can test your installation by running:

.. code-block:: bash

$ python test

Alternatively, the HTML documentation provides some simple examples of how to run Py-BOBYQA.

Examples of how to run Py-BOBYQA are given in the `documentation <>`_, and the `examples <>`_ directory in Github.

If Py-BOBYQA was installed using *pip* you can uninstall as follows:

.. code-block:: bash

$ [sudo] pip uninstall Py-BOBYQA

If Py-BOBYQA was installed manually you have to remove the installed files by hand (located in your python site-packages directory).

Please report any bugs using GitHub's issue tracker.

This algorithm is released under the GNU GPL license. Please `contact NAG <>`_ for alternative licensing.

Project details

Download files

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

Files for Py-BOBYQA, version 1.1.1
Filename, size File type Python version Upload date Hashes
Filename, size Py-BOBYQA-1.1.1.tar.gz (35.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page