Skip to main content

A Cython wrapper to the IPOPT optimization package

Project description

This repository was forked from and is now considered the primary repository. The fork includes a SciPy-style interface, ability to handle exceptions in the callback functions, and docker container for easy usage.

README for cyipopt

Ipopt (Interior Point OPTimizer, pronounced eye-pea-opt) is a software package for large-scale nonlinear optimization. Ipopt is available from the COIN-OR initiative, under the Eclipse Public License (EPL).

cyipopt is a Python wrapper around Ipopt. It enables using Ipopt from the comfort of the Python programming language.


For simple cases where you do not need the full power of sparse and structured Jacobians etc, cyipopt provides the function minimize_ipopt which has the same behaviour as scipy.optimize.minimize, for example:

from scipy.optimize import rosen, rosen_der
from ipopt import minimize_ipopt
x0 = [1.3, 0.7, 0.8, 1.9, 1.2]
res = minimize_ipopt(rosen, x0, jac=rosen_der)


The Anaconda Python Distribution is one of the easiest ways to install Python and associated packages for Linux, Mac, and Windows. Once Anaconda (or miniconda) is installed, you can install cyipopt on Linux and Mac from the Conda Forge channel with:

$ conda install -c conda-forge cyipopt

The above command will install binary versions of all the necessary dependencies and cyipopt. Note that there currently are no Windows binaries. You will have to install from source from Windows or if you want a customized installation, e.g. with MKL, HSL, etc.

To begin installing from source you will need to install the following dependencies:

  • C/C++ compiler
  • pkg-config [only for Linux and Mac]
  • Ipopt
  • Python 2.7 or 3.4+
  • setuptools
  • cython
  • numpy
  • six
  • future
  • scipy [optiional]

The binaries and header files of the Ipopt package can be obtained from These include a version compiled against the MKL library. Or you can build Ipopt from source. The remaining dependencies can be installed with conda or other package managers.

Download the source files of cyipopt and update to point to the header files and binaries of the Ipopt package, if LD_LIBRARY_PATH and pkg_config are not setup to find ipopt on their own.

Then, execute:

$ python install

Docker container

The subdirectory docker contains a docker container with preinstalled ipopt and cyipopt. To build the container, cd into the docker directory and run make. Then you can start the container by:

$ docker run -it matthiask/ipopt /bin/bash

and either call ipopt directly or start a ipython shell and import ipopt.

Vagrant environment

The subdirectory vagrant contains a Vagrantfile that installs ipopt and cyipopt in OS provision. To build the environment, cd into the vagrant directory and run vagrant up (Requires that you have Vagrant+VirtualBox installed). Then you can access the system by:

$ vagrant ssh

and either call ipopt directly or start a python shell and import ipopt. Also, if you get source files <> of coinhsl and put it in the vagrant directory, the vagrant provision will detect and add them in the ipopt compiling process, and then you will have ma57, ma27, and other solvers available on ipopt binary (ma97 and mc68 were removed to avoid compilation errors).

Reading the docs

After installing:

$ cd doc
$ make html

Then, direct your browser to build/html/index.html.


You can test the installation by running the examples under the folder test\.

Conditions of use

cyipopt is open-source code released under the EPL license.


For bug reports use the github issue tracker. You can also send wishes, comments, patches, etc. to

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 ipopt, version 0.1.9
Filename, size File type Python version Upload date Hashes
Filename, size ipopt-0.1.9.tar.gz (143.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page