Installing Repast4Py on Windows without MPI

On Windows, Repast4Py can also be installed from a pre-built Python wheel in a no-mpi mode that requires neither a native MPI installation, mpi4py, nor a C/C++ compiler. In this mode, other, non-MPI-based parallelism, such as Python’s built-in multiprocessing or thread-based parallelism, can be used to develop models. This mode also makes native windows installation easier, as an mpi distribution may be difficult to install.

Do not install the no-mpi version and the mpi version of Repast4Py in the same Python environment.

The preferred install is into a Python virtual environment. To create the environment, in a powershell or cmd terminal do:

Powershell
python -m venv path\to\repast4py_venv
path\to\repast4py_venv\Scripts\Activate.ps1
CMD
python -m venv path\to\repast4py_venv
path\to\repast4py_venv\activate.bat

The environment only needs to be created once with python -m venv …​, but does need to be activated each time in order to be used. For more information see the venv Python documentation here

Installation steps

  1. Download the wheel that matches your Python version

  2. Install the wheel in your Python environment

    Be sure your environment is activated, and from a powershell or cmd terminal

    Powershell
    path\to\repast4py_venv\Scripts\Activate.ps1
    $env:R4PY_NO_MPI=1
    pip install <wheel>
    CMD
    path\to\repast4py_venv\activate.bat
    set R4PY_NO_MPI=1
    pip install <wheel>

    Replace <wheel> with the path to the downloaded wheel. At this point, Repast4Py should be ready to use in the activated environment.