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

Revision history [back]

Problem running an E+ simulation with Python

I'm trying to run a simulation using Python. This is my code, after trying several times, but I get an error. Can you help me to solve it?:

import sys sys.path.insert(0, 'C:\EnergyPlusV9-3-0') #sys.path.insert(0, '/path/to/EnergyPlusInstallRoot') from pyenergyplus import api from pyenergyplus.api import EnergyPlusAPI from runtime import Runtime

""" run_energyplus(['-d', '/path/to/output/directory', '-w', '/path/to/weather.epw', '/path/to/input.idf']) """ test = Runtime(api)

test.run_energyplus( [ '-d', 'C:/Users/vicente.castillo/Documents/24_PROYECTO SERGIO/prueba Pyenergyplus/output_prueba', '-w', 'C:/EnergyPlusV9-3-0/ejemplo ENERGY PLUS test_2/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw', 'C:/EnergyPlusV9-3-0/ejemplo ENERGY PLUS test_2/5ZoneAirCooled.idf' ] )

Output: Traceback (most recent call last): File "prueba.py", line 15, in <module> test = Runtime(api) File "C:\Users\vicente.castillo\Documents\24_PROYECTO SERGIO\prueba Pyenergyplus\runtime.py", line 26, in __init__ self.api.energyplus.restype = c_int AttributeError: module 'pyenergyplus.api' has no attribute 'energyplus'

Problem running an E+ simulation with Python

I'm trying to run a simulation using Python. This is my code, after trying several times, but I get an error. Can you help me to solve it?:

import sys sys.path.insert(0, 'C:\EnergyPlusV9-3-0') #sys.path.insert(0, '/path/to/EnergyPlusInstallRoot') from pyenergyplus import api from pyenergyplus.api import EnergyPlusAPI from runtime import Runtime

""" run_energyplus(['-d', '/path/to/output/directory', '-w', '/path/to/weather.epw', '/path/to/input.idf']) """ test = Runtime(api)

test.run_energyplus( [ '-d', 'C:/Users/vicente.castillo/Documents/24_PROYECTO SERGIO/prueba Pyenergyplus/output_prueba', '-w', 'C:/EnergyPlusV9-3-0/ejemplo ENERGY PLUS test_2/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw', 'C:/EnergyPlusV9-3-0/ejemplo ENERGY PLUS test_2/5ZoneAirCooled.idf' ] )

Output: Traceback (most recent call last): File "prueba.py", line 15, in <module> test = Runtime(api) File "C:\Users\vicente.castillo\Documents\24_PROYECTO SERGIO\prueba Pyenergyplus\runtime.py", line 26, in __init__ self.api.energyplus.restype = c_int AttributeError: module 'pyenergyplus.api' has no attribute 'energyplus'

Problem running an E+ simulation with Python

I'm trying to run a simulation using Python. This is my code, after trying several times, but I get an error. Can you help me to solve it?:

import sys
sys.path.insert(0, 'C:\EnergyPlusV9-3-0') #sys.path.insert(0, '/path/to/EnergyPlusInstallRoot')
from pyenergyplus import api
from pyenergyplus.api import EnergyPlusAPI
from runtime import Runtime

Runtime

""" run_energyplus(['-d', '/path/to/output/directory', '-w', '/path/to/weather.epw', '/path/to/input.idf']) """ test = Runtime(api)

Runtime(api)

test.run_energyplus( [ '-d', 'C:/Users/vicente.castillo/Documents/24_PROYECTO SERGIO/prueba Pyenergyplus/output_prueba', '-w', 'C:/EnergyPlusV9-3-0/ejemplo ENERGY PLUS test_2/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw', 'C:/EnergyPlusV9-3-0/ejemplo ENERGY PLUS test_2/5ZoneAirCooled.idf' ] ))

Output:

Output:

Traceback (most recent call last):
  File "prueba.py", line 15, in <module>
    test = Runtime(api)
  File "C:\Users\vicente.castillo\Documents\24_PROYECTO SERGIO\prueba Pyenergyplus\runtime.py", line 26, in __init__
    self.api.energyplus.restype = c_int
AttributeError: module 'pyenergyplus.api' has no attribute 'energyplus'

'energyplus'