AMPL integration with Python

AMPL' All-New Python ecosystem

AMPL and all solvers are now available as python packages for Windows, Linux, and macOS. For instance, to install AMPL with HiGHS, CBC and Gurobi, you just need the following:

# Install Python API for AMPL
$ python -m pip install amplpy --upgrade

# Install solver modules (e.g., HiGHS, CBC, Gurobi)
$ python -m amplpy.modules install highs cbc gurobi

# Activate your license (e.g., free license)
$ python -m amplpy.modules activate <license-uuid>

# Import in Python
$ python
>>> from amplpy import AMPL
>>> ampl = AMPL() # instantiate AMPL object

[Python API] [Available on Google Colab] [GitHub] [AMPL Community Edition]