Installation

Setup your development environment to use the Modelpy framework.


1: Install Python

Before you can start using the Modelpy framework, you need to have Python installed on your local system. If you haven't installed Python yet, you can download the correct version for your operating system from the official Python website.

Follow their installation instructions to complete the setup. After installing Python, you can verify the installation by opening a terminal or command prompt and running:

python --version

You should see the installed Python version printed in the terminal.

2: Install Pip

Pip is a package manager for python. If you wish to use additional python packages to build your model, like networkx, you will need to use pip to install them. The manual installation instructions are listed here, but you can reference them on pip's documentation here.

Manual Installation:

Pip usually comes pre-installed with Python on Windows. However, if you need to install or upgrade Pip separately including on Mac or Linux systems, you can follow these steps:

  1. Download the get-pip.py script.
  2. Open a command prompt and navigate to the directory containing the downloaded script.
  3. Run the following command to install Pip:
python get-pip.py

After installation, you can verify Pip by running:

pip --version

To install additional python packages, use the following command in the root directory of your project:

pip install {{insert_package_name}}

For instance, to install networkx, use the following command in the root directory of your project:

pip install networkx

3: Install Modelpy Package

Now that you have properly installed python and pip, you can install the additional packages that will be needed for your python project. These packages include our Modelpy Python module modelpy-abm, networkx (which is commonly used for graphical models), and numpy.

You can install these packages using pip.

pip install modelpy-abm
pip install networkx
pip install numpy

4: Create Your Python Project

With the your python environment configured, you can now start building your Python model! Create a folder/directory for your python project where you can start coding your model.