Prerequisites: Install Required Tools¶
This guide explains how to install the essential tools needed to run the EPM model on macOS or Windows.
You’ll need:
- Git (to download and manage the code)
- GAMS (required to run the model)
- Python & Conda (optional, for enhanced functionalities via the Python API)
- A code editor (optional, to help navigate and edit the codebase)
1. Git (Version Control System)¶
Git is used to download the EPM code from the GitHub repository and manage version updates.
-
Windows:
Download Git for Windows and install it using default settings. -
macOS:
Download Git for macOS and follow the installer instructions. -
Verify installation:
Open Terminal or Command Prompt and run:
2. GAMS (Optimization Engine)¶
GAMS is used to solve the energy planning model. A free version with limited capabilities is available for non-commercial use.
- Download (all platforms):
https://www.gams.com/download/
Ask your institution or the World Bank team if you need a full license.
We are using gamsapi version >= 48.2.0, so you should run a version of GAMS between 48.2.0 (released on October 29, 2024) and 53.x. Continuous integration runs on GAMS 53.5.1.
GAMS 54.x is not yet supported
GAMS 54.x returns gams-transfer records with categorical dtypes, which breaks input verification and treatment. Use 53.x or earlier.
Add GAMS to Your System PATH¶
This step allows you to call gams from your terminal or command line.
On Windows¶
- Open GAMS Studio → go to
Help > About→ copy the install path (e.g.,C:\GAMS\40.1) - Search for Environment Variables in the Start Menu and open it.
- In the System Properties window:
- Click
Environment Variables - Under System Variables, select
Pathand clickEdit - Click
New, then paste the GAMS path - Click OK and close all dialogs.
- Open a new Command Prompt and test:
On macOS¶
- Locate your GAMS installation (e.g.,
/Applications/GAMS40.1) - Open Terminal and run:
- Add the following line:
- Save and apply changes:
You should now be able to run GAMS from the terminal.
3. Python & Conda (Optional but Recommended)¶
Python is used to run EPM through its Python API, enabling advanced features such as scenario generation and Monte Carlo analysis.
-
Install Miniconda (all platforms):
https://docs.conda.io/en/latest/miniconda.html
Download the installer for your operating system and follow the setup instructions. -
Verify installation:
Open Terminal or Command Prompt and run:
4. Code Editor (Optional)¶
A code editor helps you navigate, compare, and edit model files efficiently—even if you don't plan to modify the Python code.
Recommended Editors¶
- Visual Studio Code (recommended)
- PyCharm
These editors also offer:
- Git integration to track changes and synchronize with the repository
- File diff tools to compare versions
- Syntax highlighting and code validation
We especially recommend using them to:
- Compare your regional/country version of the model with updates from the main EPM framework
- Merge changes when the EPM core is updated to maintain compatibility
By installing these tools, you'll be ready to run and explore the EPM model both through GAMS Studio and Python scripting.