Windows
EMOD is easiest to install (and use) in Windows.
Ingredients
- Access to the
dtk-tools
and dtk-tools-malaria
github repository.
- The excutable binary
Eradication.exe
- Administrator access to a Windows OS preferably with PowerShell (This should be available by default in Windows 7 onwards)
- Install Python 3.6.0: Download the installer here for 64-bit system or 32-bit (Note: this is rare.) Check the checkbox “Add Python 3.6.0 to PATH” to make your life easier.
- Set up environment variables PATH. (Note: If you did the checkbox in previous step, you can skip this)
- In the Windows Search Bar, type “Environment” and this should typically point you to “Edit the system environment variables”, then click on it.
- Alternatively, go to “Control Panel” -> “System and Security” -> “System” -> “Advanced System Settings”
- Click “Environment Variables” button
- In the “System variables” section, look out for the “Path” entry, double click on it.
- Here you will need to fill in the path to your
python.exe
and pip.exe
- This is typically in
C:\Users\(username)\AppData\Local\Programs\Python\Python36
and C:\Users\(username)\AppData\Local\Programs\Python\Python36\Scripts
. Both are required to be added.
- Now launch your powershell (or other terminal such as CMD, or PyCharm terminal). And navigate to your “work folder” (e.g., mine is
C:\Users\(username)\
)
- Easiest way is to type “powershell” in your search bar (or “echo %homepath%” in cmd/ pycharm terminal").
- If not, you can go to “Start” menu and look for it.
- Install
virtualenv
using pip
- Command:
pip install virtualenv
- Create a virtual environment of name of your choice. I use
dtk
for mine.
- Command:
virtualenv dtk
- Virtual environment creates a compartment in your computer in which you need to separately install packages of your choice. Two virtual environments can carry different set of packages.
- Activate the virtual environment of your choice.
- Command:
dtk\Scripts\activate
- You should notice now your prompt is preceded by
(dtk)
(or name of your environment)
- Note if you see the error message ‘activate.ps1 cannot be loaded because running scripts is disabled on this system’ you can either set the execution policies to allow you to run Powershell script, or use a different terminal than powershell (about_Execution_Policies).
- To set the execution policies, run Powershell as an administrator. Type “powershell” in your search bar, when the “Windows powershell” app pops up, right click on it, and “Run as administrator”. Then type
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
. This step lets your Powershell to execute scripts that are at least remotely signed. Then you can go back to your original terminal to activate the virtual environment.
- Now it’s time to install
dtk-tools
and its associated packages. Clone the git repository to wherever you want it to be. Navigate over.
- Say
C:\Users\(username)\work
.
- Navigate to the cloned repository, say
C:\Users\(username)\work\dtk-tools
- Install the tool using
setup_manual.py
script
- Command:
python setup_manual.py
- Yes, there is a
setup.py
script but we typically have better success using the separate script
- If you don’t see any noticeable error messages, use
dtk version
command to verify if you successfully installed the dtk-tools
, if successful you will see the image below:
- Clone the git repository to wherever you want it to be. Navigate over.
- Activate the virtual environment of your choice, if you haven’t already.
- Install the tool using
setup.py
script
- Command:
python setup.py develop
- This is the “standard” way to install a custom package for python. Specifying the
develop
behind allows changes made to the code repository to directly reflect in the package. Sometimes, you want to use install
instead: future changes to the code repository will not be captured into the installed package in your computer until you rerun the command.
- If there are no clear error messages, go to the next section to verify that both
dtk-tools
and dtk-tools-malaria
are installed successfully and useable!
Verify that you are all set!
- Navigate to the
dtk-tools-malaria
folder and go to the examples
subfolder.
- Edit the
simtools.ini
(using PyCharm or Notepad++) to make sure that they are pointing to the right path. I.e., change all the path\to
to correspond to the location of your dtk-tools-malaria
folder.
- In your terminal, run the
run_exampleSim.py
script in the examples
subfolder.
- Command:
python run_exampleSim.py
- If the simulation runs successfully, both
dtk-tools
and dtk-tools-malaria
are successfully installed in your machine.
- If it failed, you can cross-check with the troubleshooting sections.