EMerge logo EMerge Template Explorer
← Back to templates

Installing Python and EMerge

Everything in this library is a plain Python script. To run one, you need Python itself and the emerge package installed on your own computer, there is no way to run a simulation from inside this website. This guide walks through both steps for Windows, macOS, and Linux.

Windows

1. Install Python

  1. Go to python.org/downloads and download the latest Python 3 installer.
  2. Run the installer. On the very first screen, tick "Add python.exe to PATH" before clicking Install. This step is easy to miss and is the most common reason python or pip is not recognized afterward.
  3. Open a terminal: press the Windows key, type cmd (Command Prompt) or PowerShell, and press Enter.
  4. Check that it worked:
python --version
pip --version

Both commands should print a version number. If they say "not recognized," reinstall Python and make sure to tick the PATH checkbox.

2. Install EMerge

The current stable release is version 2.8:

pip install emerge

Version 3.0 is in alpha. Several templates in this library target it; install it with the --pre flag instead:

pip install --pre emerge

macOS

1. Install Python

  1. Go to python.org/downloads and download the macOS installer (a .pkg file), then run it. (If you already use Homebrew, brew install python works too.)
  2. Open the Terminal app: press Cmd+Space, type Terminal, and press Enter.
  3. Check that it worked. On macOS the commands are usually python3 and pip3, not python/pip:
python3 --version
pip3 --version

2. Install EMerge

Stable release (2.8):

pip install emerge

3.0 alpha instead:

pip install --pre emerge

3. macOS only: install the Accelerate solver interface

On macOS, also install this package regardless of which EMerge version you chose above. It lets EMerge use Apple's Accelerate framework for faster sparse solves:

pip install git+https://github.com/FennisRobert/emerge-aasds

This step needs git installed. If the command fails saying git is not found, install it first by running git --version in Terminal, which on a fresh Mac will prompt you to install Apple's Command Line Tools, then run the command above again.

Linux

1. Install Python

Most distributions already have Python 3. Check first:

python3 --version

If that fails, install it and pip through your package manager:

# Debian / Ubuntu
sudo apt install python3 python3-pip

# Fedora
sudo dnf install python3 python3-pip

# Arch
sudo pacman -S python python-pip

Open a terminal from your application menu, or with the Ctrl+Alt+T shortcut on many distributions.

2. Install EMerge

Stable release (2.8):

pip install emerge

3.0 alpha instead:

pip install --pre emerge

If pip is not recognized, use pip3 instead.

Verify it worked

Run this in your terminal. It should finish with no output and no error:

python -c "import emerge"

Use python3 instead of python if that's what worked for you above.

From here, pick any template on the explorer page, copy its source with the copy button, paste it into a .py file, and run it with python your_file.py.