1. Select license type:
For additional support, contact the AMPL team at support@ampl.com.
For additional support, contact the AMPL team at support@ampl.com.
For additional support, contact the AMPL team at support@ampl.com.
AMPL and all solvers are available as python packages for Windows, Linux (X86_64, aarch64, ppc64le), and macOS.
# 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 https://ampl.com/ce license)
$ python -m amplpy.modules activate
# Import AMPL into the Python
$ python
>>> from amplpy import AMPL
>>> ampl = AMPL() # instantiate AMPL object
Enhance your AMPL workflow with VS Code’s powerful editor and the official AMPL extension, enabling you to write, run, and debug models seamlessly in one environment.
ampl.pathToExecutable setting (e.g., C:\ampl\ampl.mswin64). Leave empty to use AMPL from your system’s PATH.)
from amplpy import AMPL
ampl = AMPL()
ampl.eval("option ampl_license YOUR_LICENSE;")
!pip install amplpy(Replace YOUR_LICENSE with your actual license string.)
AMPL Model Colaboratory is a collection of AMPL models in Jupyter Notebooks that run on platforms such as Google Colab, Kaggle, Gradient, and AWS SageMaker. In order to be use AMPL on these notebook platforms you just need to following two code blocks at the beginning of your notebook:
# Install dependencies
%pip install -q amplpy
# Google Colab & Kaggle integration
from amplpy import AMPL, ampl_notebook
ampl = ampl_notebook(
modules=["gurobi", "cbc", "highs"], # modules to install
license_uuid="default") # license to use
Place ampl.mswin64 in a folder where you have write permissions without requiring Administrator access.
amplide folder in your AMPL directory and double-click amplide.exe.sw.exe icon and type ampl at the prompt in the window that appears. Then you will see an ampl: prompt and can proceed to type AMPL commands.Note: you need to restart AMPL in order to start using the new license.
ampl: shell "amplkey activate --uuid ";
# replace by the license UUID
It is recommended to install AMPL in your home folder. Otherwise, if you use dynamic cloud licenses, make sure the AMPL folder is not read-only (e.g., it will not work if installed at "C:\Program Files\AMPL").
You will need to tell macOS that your AMPL software is safe to run.
Double-click your AMPL folder to open it and then follow these steps:
ampl: in the last line in the window. You can now close the window. “Amplide” is damaged and can’t be opened. You need to run ampl.command to tell macOS that your AMPL software is safe to run.
ampl. You should see an ampl: prompt appear and can now proceed to enter AMPL commands.For macOS, we have an installer available that asks for the license UUID at the end for the installation process.
In case you have AMPL already installed, activate your license if you received a license UUID (e.g., AMPL CE or AMPL for Courses licenses):
Run this command in AMPL to activate your license:
ampl: shell "amplkey activate --uuid ";
# replace by the license UUID
Note: you need to restart AMPL in order to start using the new license.
If you install AMPL somewhere in your home directory, you do not need to worry about the following.
If you use cloud licenses (e.g., AMPL Community Edition licenses), the AMPL directory cannot be read-only. If really you want to have AMPL installed on a read-only directory, you need to set the environment variables AMPL_LICFILE to a location where you store ampl.lic and where you have permissions to write, and set AMPLKEY_RUNTIME_DIR to a temporary directory.
ampl: shell "amplkey activate --uuid ";
# replace by the license UUID
Note: you need to restart AMPL in order to start using the new license.
If you install AMPL somewhere in your home directory, you do not need to worry about the following.
If you use cloud licenses (e.g., AMPL Community Edition licenses), the AMPL directory cannot be read-only. If you really want to have AMPL installed on a read-only directory, you need to set the environment variables:
AMPL_LICFILE to a location where you store ampl.lic and where you have permissions to writeAMPLKEY_RUNTIME_DIR to a temporary directoryFor instance, assuming that you want to install AMPL on a Linux system in the /opt directory, which is not writeable by normal users. To install AMPL and dynamic licenses, you need to do the following:
/opt as root user. The executables should then be at /opt/ampl.linux-intel64/.export AMPL_LICFILE=$HOME/.ampl/ampl.lic
export AMPLKEY_RUNTIME_DIR=$HOME/.ampl
export PATH=/opt/ampl.linux-intel64/:$PATH
and add those definitions to the .bash_profile or .bashrc of each user.
amplkey_activate --uuid <license-uuid> command in the terminal.Place AMPL in a directory where you have write permissions such as your home directory. Otherwise, please see the note at the end.
amplide and run the amplide executable.cd to go to your AMPL directory, then type ./ampl at the system prompt. Then you will see an ampl: prompt and can proceed to type AMPL commands.Yes, AMPL is widely used in academic research and publications across various fields, including operations research, economics, engineering, and applied mathematics. Its flexibility, powerful modeling capabilities, and compatibility with numerous solvers make it an excellent tool for developing, testing and implementation of optimization models.
Researchers frequently cite AMPL in peer-reviewed journals and conference papers. If you use AMPL in your work, you may:
AMPL is a powerful algebraic modeling language widely used in optimization for its flexibility, efficiency, and integration capabilities. Key features in modern workflows include:
For modern workflows, combining AMPL’s modeling power with Python’s ecosystem (e.g., Pandas, NumPy) via the AMPL Python API is particularly popular. The MP Interface is favored for solver customization.
Contact us: 📧 support@ampl.com
Or visit our support forum: 💬 discuss.ampl.com