Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

The most direct fix to your line of code is:

subprocess.call(['C:\EnergyPlusV8-5-0\energyplus.exe', '-w', 'path/to/weather.epw', 'PackagedTerminalHeatPump.idf'])

The EnergyPlus executable always comes first in the list of arguments passed to subprocess.call (or check_call or Popen), and the IDF comes last. For the other options, you specify the option, then its argument (where required).

Here is the CLI help which you may find useful in building up your command.

EnergyPlus, Version 8.5.0-c87e61b44b
Usage: energyplus [options] [input-file]
Options:
  -a, --annual                 Force annual simulation
  -d, --output-directory ARG   Output directory path (default: current
                               directory)
  -D, --design-day             Force design-day-only simulation
  -h, --help                   Display help information
  -i, --idd ARG                Input data dictionary path (default: Energy+.idd
                               in executable directory)
  -m, --epmacro                Run EPMacro prior to simulation
  -p, --output-prefix ARG      Prefix for output file names (default: eplus)
  -r, --readvars               Run ReadVarsESO after simulation
  -s, --output-suffix ARG      Suffix style for output file names (default: L)
                                  L: Legacy (e.g., eplustbl.csv)
                                  C: Capital (e.g., eplusTable.csv)
                                  D: Dash (e.g., eplus-table.csv)
  -v, --version                Display version information
  -w, --weather ARG            Weather file path (default: in.epw in current
                               directory)
  -x, --expandobjects          Run ExpandObjects prior to simulation
Example: energyplus -w weather.epw -r input.idf

I've wrapped this up in a little module you can find here. So long as EnergyPlus is installed in the usual place for your system and the install directory is on your path then this ought to work straight out of the box.