Install#

Follow the steps below to install emodpy-measles.

Prerequisites#

First, ensure the following prerequisites are met.

  • Windows 10 Pro or Enterprise, Linux, or Mac

  • Python 3.9 64-bit (https://www.python.org/downloads/release)

  • A file that indicates the pip index-url:

    • For Windows, in C:\Users\Username\pip\pip.ini add the following:

      [global]
      index-url = https://packages.idmod.org/api/pypi/pypi-production/simple
      
    • For Linux, in $HOME/.config/pip/pip.conf add the following:

      [global]
      index-url = https://packages.idmod.org/api/pypi/pypi-production/simple
      

Standard installation instructions#

  1. Open a command prompt and create a virtual environment in any directory you choose. The command below names the environment “v-emodpy-measles”, but you may use any desired name:

    python -m venv v-emodpy-measles
    
  2. Activate the virtual environment:

    • Windows

    • Linux

    Enter the following:

    v-emodpy-measles\Scripts\activate
    

    Enter the following:

    source v-emodpy-measles/bin/activate
    
  3. Install emodpy-measles packages:

    pip install emodpy-measles
    

    If you are on Linux, also run:

    pip install keyrings.alt
    
  4. When you are finished, deactivate the virtual environment by entering the following at a command prompt:

    deactivate
    

Developer installation#

Use a virtual environment as described in the standard installation. You then have several options if you are modifying the code locally:

Option 1: Create a hard link to package_setup.py available to pip:

ln package_setup.py setup.py

and then install in the emodpy-measles directory:

pip install -e .

Option 2: Each time you make a change you want to use:

python package_setup.py bdist_wheel
pip install dist\emodpy_measles-XXX.whl

Windows#

To properly install Shapely on Windows (necessary for the emod-api documentation) and/or if Snappy compression support is desired or needed, consider downloading and installing the latest python-snappy package for Windows from Christoph Gohlke’s Python package website.

Example#

For instructions to run a measles example scenario, see InstituteforDiseaseModeling/emodpy-measles.