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
- Go to python.org/downloads and download the latest Python 3 installer.
- 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
pythonorpipis not recognized afterward. - Open a terminal: press the Windows key, type cmd (Command Prompt) or PowerShell, and press Enter.
- Check that it worked:
python --version
pip --versionBoth 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 emergeVersion 3.0 is in alpha. Several templates in this library target it; install it with the --pre flag instead:
pip install --pre emergemacOS
1. Install Python
- Go to python.org/downloads and download the macOS installer (a
.pkgfile), then run it. (If you already use Homebrew,brew install pythonworks too.) - Open the Terminal app: press Cmd+Space, type Terminal, and press Enter.
- Check that it worked. On macOS the commands are usually
python3andpip3, notpython/pip:
python3 --version
pip3 --version2. Install EMerge
Stable release (2.8):
pip install emerge3.0 alpha instead:
pip install --pre emerge3. 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-aasdsThis 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 --versionIf 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-pipOpen 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 emerge3.0 alpha instead:
pip install --pre emergeIf 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.