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:
python -m venv path\to\repast4py_venv
path\to\repast4py_venv\Scripts\Activate.ps1
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
-
Download the wheel that matches your Python version
-
Install the wheel in your Python environment
Be sure your environment is activated, and from a
powershellorcmdterminalPowershellpath\to\repast4py_venv\Scripts\Activate.ps1 $env:R4PY_NO_MPI=1 pip install <wheel>CMDpath\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.