Frequently Asked Questions

1. Select license type:

2
Sign up on portal.ampl.com
Use academic email
3
To obtain a license and read the instructions for its further use in various systems.

For additional support, contact the AMPL team at support@ampl.com.

2
Sign up on portal.ampl.com
Use academic email
3
To fill out the request form
4
To obtain a license and read the instructions for its further use in various systems.

For additional support, contact the AMPL team at support@ampl.com.

2
Sign up on portal.ampl.com
Use your company email
3
To fill out the request form
4
To obtain a license and read the instructions for its further use in various systems.

For additional support, contact the AMPL team at support@ampl.com.

AMPL Integration with Python

AMPL and all solvers are available as python packages for Windows, Linux (X86_64, aarch64, ppc64le), and macOS.

1
Install Pytnon
Download and install the latest version of Python from the Official Python Website.
2
Activate your AMPL license
To install AMPL with popular solvers like HiGHS, CBC, or Gurobi, just run 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 https://ampl.com/ce license)
$ python -m amplpy.modules activate <license-uuid>

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

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.

1
Install VS Code
Download and install VS Code from the official Visual Studio Code website.
2
  • Open VS Code.
  • Go to the Extensions view (Ctrl+Shift+X (Windows/Linux) / Cmd+Shift+X (macOS) or click on the Extensions icon in the Activity Bar).
  • Search for "AMPL" or "AMPL (Official)" in the marketplace.
  • Click "Install" on the AMPL extension tile.
  • 3*
    Configure AMPL executable path (Optional):
  • Go to Settings → Extensions → AMPL.
  • Specify the path to your AMPL executable in the ampl.pathToExecutable setting (e.g., C:\ampl\ampl.mswin64). Leave empty to use AMPL from your system’s PATH.)
  • 4
    Start using AMPL in VS Code
  • Open your AMPL (.mod, .run, .dat) files in VS Code.
  • Use the extension’s features: Syntax highlighting, Model execution, Debugging tools.
  • 				
    					from amplpy import AMPL
    ampl = AMPL()
    ampl.eval("option ampl_license YOUR_LICENSE;")
    				
    			
    AMPL Integration with Jupyter Notebook 
    1
    Install amplpy:
    Run the following command in a Jupyter Notebook cell to install the package (Python):
    !pip install amplpy
    2
    Set Up AMPL License:
    If you have an AMPL license, configure it using (Python):

     (Replace YOUR_LICENSE with your actual license string.)

    AMPL Integration with Coogle Colab, Kaggle, Gradient, and AWS SageMaker

    AMPL Model Colaboratory is a collection of AMPL models in Jupyter Notebooks that run on platforms such as Google ColabKaggleGradient, 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
    				
    			
    Installing AMPL for Windows
    1
    Sign in | Sing up at AMPL Portal
    Use an email that meets your license requirements. For details, refer to '1. How to get a license?' in the FAQ section.
    2
    Download AMPL
    Download AMPL from the "Step 1: Download AMPL & Solvers → Other → Windows" tab.
    3
    Install AMPL
  • Run the provided Windows installer.
  • Copy Your AMPL License UUID from: "Step 2: Activate your license to remove AMPL size-limits"
  • Activate your license (The installer will prompt you for your license UUID).
  • 4
    Use Your Favorite IDE for Modeling
  • AMPL IDE
  • Official AMPL Extension for VS Code
  • Notepad++
  • Sublime Text
  • Installing AMPL for Windows
    1
    Sign in | Sing up at AMPL Portal
    Use an email that meets your license requirements. For details, refer to '1. How to get a license?' in the FAQ section.
    2
    Download AMPL
    Download AMPL from the "Step 1: Download AMPL & Solvers → Other → Windows" tab.
    3
    Install or Extract AMPL
  • Windows Installer: Run the provided installer. (Recommended)
  • Manual Extraction: Extract the AMPL files to create your AMPL folder. You may rename or move this folder to any convenient location on your computer.

  • i
    Note

    Place ampl.mswin64 in a folder where you have write permissions without requiring Administrator access.

    4
    Copy Your AMPL License UUID
    Copy the UUID from: "Step 2: Activate your license to remove AMPL size-limits".
    5
    Running AMPL
  • Via IDE: Navigate to the amplide folder in your AMPL directory and double-click amplide.exe.
  • Via Command Line: Inside your AMPL folder, double-click the 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.
  • 6
    Activate your license to remove AMPL size-limits
  • New Installation (Windows): The installer will prompt you for your license UUID.
  • Existing Installation: Activate your license by entering the UUID (e.g., for AMPL CE or AMPL for Courses licenses).
  • Run this command in AMPL to activate your license:

    Note: you need to restart AMPL in order to start using the new license.

    				
    					ampl: shell "amplkey activate --uuid <license-uuid>";
          # replace <license-uuid> by the license UUID
    				
    			
    i
    Note

    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").

    Installing AMPL for macOS
    1
    Sign in | Sing up at AMPL Portal
    Use an email that meets your license requirements. For details, refer to '1. How to get a license?' in the FAQ section.
    2
    Download AMPL
    Download AMPL from the "Step 1: Download AMPL & Solvers → Other → macOS" tab.
    3
    Install AMPL
  • Run the provided Windows installer.
  • Copy Your AMPL License UUID from: "Step 2: Activate your license to remove AMPL size-limits"
  • Activate your license (The installer will prompt you for your license UUID).
  • 4
    Use Your Favorite IDE for Modeling
  • AMPL IDE
  • Official AMPL Extension for VS Code
  • Notepad++
  • Sublime Text
  • 1
    Sign in | Sing up at AMPL Portal
    Use an email that meets your license requirements. For details, refer to '1. How to get a license?' in the FAQ section.
    2
    Download AMPL
    Download AMPL from the "Step 1: Download AMPL & Solvers → Other → macOS" tab.
    3
    Install or Extract AMPL
  • macOS Installer: Run the provided installer. (Recommended)
  • Manual Extraction: Extract the AMPL files to create your AMPL folder. You may rename or move this folder to any convenient location on your computer.

  • i
    Note

    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:

  • Control-click the ampl.command file and select ‘Open’ in the context menu.
    - If a warning message (“macOS cannot verify the developer…”) pops up, click ‘Open’.
    - A Terminal window will appear. After a few seconds, you will see ampl: in the last line in the window. You can now close the window.
    (If a warning message saying “Do you want to terminate running processes in this window?” pops up, click ‘Terminate’.)

    Attention!!!: If this step is skipped, you will get errors such as: “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.
  • 4
    Copy Your AMPL License UUID
    Copy the UUID from: "Step 2: Activate your license to remove AMPL size-limits".
    5
    Running AMPL
  • Via IDE: In your AMPL folder, enter the amplide folder and then double-click the Amplide application (with a black cat’s-head icon) to start the IDE. (The first time you open the AMPL IDE, you might see a few “Amplide would like to access files” boxes at startup; click OK in each box to dismiss it.)
  • Via Command Line: In your AMPL folder, double-click ampl. You should see an ampl: prompt appear and can now proceed to enter AMPL commands.
  • 6
    Activate your license to remove AMPL size-limits
  • New Installation (macOS): The installer will prompt you for your license UUID.
  • Existing Installation: Activate your license by entering the UUID (e.g., for AMPL CE or AMPL for Courses licenses).
  • Run this command in AMPL to activate your license:

    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 <license-uuid>";
          # replace <license-uuid> by the license UUID
    				
    			

    Note: you need to restart AMPL in order to start using the new license.

    i
    Note

    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.

    Installing AMPL for Linux
    1
    Sign in | Sing up at AMPL Portal
    Use an email that meets your license requirements. For details, refer to '1. How to get a license?' in the FAQ section.
    2
    Download AMPL
    Download AMPL from the "Step 1: Download AMPL & Solvers → Other → Linux" tab.
    3
    Install AMPL
  • Run the provided Windows installer.
  • Copy Your AMPL License UUID from: "Step 2: Activate your license to remove AMPL size-limits"
  • Activate your license (The installer will prompt you for your license UUID).
  • 4
    Use Your Favorite IDE for Modeling
  • AMPL IDE
  • Official AMPL Extension for VS Code
  • Notepad++
  • Sublime Text
  • 				
    					ampl: shell "amplkey activate --uuid <license-uuid>";
          # replace <license-uuid> by the license UUID
    				
    			

    Note: you need to restart AMPL in order to start using the new license.

    i
    Note

    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 write
    • AMPLKEY_RUNTIME_DIR to a temporary directory

    For 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:

    1. Unpack the AMPL tarball into /opt as root user. The executables should then be at /opt/ampl.linux-intel64/.
    2. For each user that wants to use this AMPL installation with their own license:
      1. Define environment variables to point to a writeable directory in the user home directory:
        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.
    3. Start a new terminal to load the new environment variable definitions.
    4. Run the amplkey_activate --uuid <license-uuid> command in the terminal.
    1
    Sign in | Sing up at AMPL Portal
    Use an email that meets your license requirements. For details, refer to '1. How to get a license?' in the FAQ section.
    2
    Download AMPL
    Download AMPL from the "Step 1: Download AMPL & Solvers → Other → Linux" tab.
    3
    Install or Extract AMPL
  • Linux Installer: Run the provided installer. (Recommended)
  • Manual Extraction: Extract the AMPL files to create your AMPL directory. You may rename or move this directory to any convenient location on your computer.

  • i
    Note

    Place AMPL in a directory where you have write permissions such as your home directory. Otherwise, please see the note at the end.

    4
    Copy Your AMPL License UUID
    Copy the UUID from: "Step 2: Activate your license to remove AMPL size-limits".
    5
    Running AMPL
  • Via IDE: Inside your AMPL folder, enter the directory named amplide and run the amplide executable.
  • Via Command Line: In a command window, use 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.
  • 6
    Activate your license to remove AMPL size-limits
  • New Installation (Linux): The installer will prompt you for your license UUID.
  • Existing Installation: Activate your license by entering the UUID (e.g., for AMPL CE or AMPL for Courses licenses).
  • Run this command in AMPL to activate your license:
    1
    Utilize the Free AMPL for Courses Program:
    AMPL offers a free bundle of the full-featured software with no limitations on problem size for academic courses. This includes access to commercial solvers like Gurobi, CPLEX, and Xpress, as well as open-source alternatives like CBC. You can easily obtain and distribute this bundle to your students through a license portal request. The licenses are time-limited, expiring after the course concludes.
    2
    Introduce AMPL's Python API (amplpy):
    Integrate AMPL and solvers directly into the Google Colab environment using your course bundle's UUID. This allows you to use more then 100 ready-to-use models and create examples in Colab and share them easily with students, who can access the full AMPL license without local installations, and save or submit their work in the cloud. Learn more about amplpy and its Colab integration.
    3
    Emphasize AMPL's Strengths:
    Highlight AMPL's intuitive, algebraic modeling language that closely mirrors mathematical notation. Emphasize the clear separation of model and data, which facilitates easier testing and experimentation. Showcase the wide range of optimization problems AMPL can handle, including linear, nonlinear, and mixed-integer problems. See books for learn the theory and comprehensive examples.
    4
    Teach Python Integration:
    Teach students how to access AMPL's features from within Python using amplpy. This allows them to integrate AMPL into their data science workflows, using tools like Pandas and NumPy for data manipulation and analysis. You can also teach them to build web applications with Python scripts, amplpy, Pandas, and Streamlit. Check out the amplpy Best Practice guide and Streamlit examples.
    5
    Provide Practical Examples and Tutorials:
    Use the numerous examples available from the Books, along with the variety of scripts for common iterative schemes, to illustrate different applications of AMPL.
    6
    Explore Different Solvers:
    Introduce students to various solvers compatible with AMPL, both commercial (like CPLEX and Gurobi) and open-source (like CBC and HiGHS). Explain the strengths of each solver and guide students in choosing the appropriate solver for different problem types. The ability to easily switch solvers without modifying the model is a key benefit of AMPL. See the AMPL solvers page for comparisons.
    7
    Encourage Advanced Modeling Techniques:
    Introduce advanced features like using sets, parameters https://mp.ampl.com/model-guide.html MP Interface to model complex systems, implementing constraints and objective functions effectively, and using AMPL's scripting capabilities for dynamic modeling and sensitivity analysis. The AMPL Webinars and video tutorials offer excellent advanced material.

    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.

    Why Use AMPL for Academic Research?

    AMPL in Publications

    Researchers frequently cite AMPL in peer-reviewed journals and conference papers. If you use AMPL in your work, you may:

    • Reference the AMPL book (Fourer, R., Gay, D. M., & Kernighan, B. W. (2002). AMPL: A Modeling Language for Mathematical Programming.)
    • Acknowledge the AMPL software and any solvers used.
    Learning AMPL and mathematical optimization is supported by a variety of resources, including official documentation, books, online courses, and community forums. Here are some key resources to help you get started:
    Official AMPL Resources:

    AMPL is a powerful algebraic modeling language widely used in optimization for its flexibility, efficiency, and integration capabilities. Key features in modern workflows include:

    1
    Algebraic Modeling Syntax
    Intuitive, readable formulation of optimization problems using sets, parameters, variables, and constraints
    2
    Seamless Solver Integration
    Supports commercial (e.g., Gurobi, CPLEX) and open-source solvers (e.g., COIN-OR, Ipopt).
    3
    Python Integration (AMPL Python API)
    Enables scripting, automation, and embedding AMPL in Python workflows (e.g., data preprocessing, post-processing, and machine learning pipelines).
    4
    MP (Math Program) Interface
    Allows low-level interaction with solvers for custom algorithm development and advanced control.
    5
    Data Handling & Connectivity
    Supports CSV, SQL, and other data sources for large-scale optimization.
    6
    Rapid Prototyping & Debugging
    Features like display and let commands help validate models efficiently.

    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