Skip to content

Quick Installation

Pockit supports Python 3.11 and later. For most users, conda-forge is the recommended installation method: it installs Pockit, CyIpopt, and the native Ipopt libraries together, with no local compilation. The conda package is named pockit-optimal-control, while Python code imports pockit.

Create a dedicated environment and install Pockit:

conda create -n pockit -c conda-forge pockit-optimal-control
conda activate pockit

This single package provides both the Ipopt and SciPy backends. To run examples that produce figures, add Matplotlib:

conda install -c conda-forge matplotlib

Verify the installation with:

python -c "import cyipopt, pockit; from pockit.optimizer import ipopt, scipy; print('Pockit is ready')"

To add Pockit to an existing conda environment instead, run:

conda install -c conda-forge pockit-optimal-control

Alternative: PyPI

If conda is unavailable, install the package from PyPI in a virtual environment:

python -m venv .venv
# Windows: .venv\Scripts\activate
# Linux/macOS: source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install pockit-optimal-control

The base PyPI installation includes the SciPy backend. To run plotting examples, install the examples extra:

python -m pip install "pockit-optimal-control[examples]"

Using the Ipopt backend from a PyPI installation also requires a compatible native Ipopt library. Unless you specifically need a custom Ipopt build, use the recommended conda-forge installation above. The manual Ipopt installation guide covers the remaining cases.

Install from Source

For development, clone the repository and install it in editable mode. Do not copy the pockit/ directory into another project:

git clone https://github.com/zouyilin2000/pockit.git
cd pockit
python -m pip install -e ".[examples]"
python -m pip install pytest
python -m pytest -q

See Optimizer Selection for backend trade-offs.