5

python plugin for EnergyPlus issues

I see EnergyPlus has a Python plugin to couple simulations between energyplus and python script. I have two questions: (1) how to run such simulation through EP-Launch?
I tried one example through EP-launch:

PythonPluginCustomSchedule.idf

The error i got:

Program Version,EnergyPlus, Version 9.4.0-998c4b761e, YMD=2020.12.28 11:14,
** Severe  ** Failed to import module "PythonPluginCustomSchedule"
**   ~~~   ** Python error description follows: 
**   ~~~   ** ModuleNotFoundError("No module named 'PythonPluginCustomSchedule'")
**  Fatal  ** In reportPythonError(), traceback.format_exception did not return a list.
...Summary of Errors that led to program termination:
..... Reference severe error count=1
..... Last severe error=Failed to import module "PythonPluginCustomSchedule"
**  Fatal  ** In reportPythonError(), traceback.format_exception did not return a list.
...Summary of Errors that led to program termination:
..... Reference severe error count=1
..... Last severe error=Failed to import module "PythonPluginCustomSchedule"*

(2) is it only working at command line?

ep_user's avatar
151
ep_user
asked 2020-12-28 10:30:37 -0500
Julien Marrec's avatar
29.7k
Julien Marrec
updated 2021-01-04 03:13:27 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

3 Answers

3

Hi,

You have to add the folder path to the energyplus file. For doing so, you have to go to the "Python Plugin System" section of the idf file and add the folder path to the system. The name section should be "PythonPluginCustomSchedule" and the search path section should be: "C:\EnergyPlusV9-4-0\ExampleFiles"

Keep in mind that the search path should be the containing folder, not the python path!

See the attached photo:image description

Hope it works!

Mostafa Meimand's avatar
217
Mostafa Meimand
answered 2021-01-03 18:55:05 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

Alternatively to what Mostafa suggested, you may just have forgotten to copy the PythonPluginCustomSchedule.py in the same folder as the PythonPluginCustomSchedule.idf file?

Julien Marrec's avatar
29.7k
Julien Marrec
answered 2021-01-04 03:17:39 -0500
edit flag offensive 0 remove flag delete link

Comments

Have you tried this out? I also have problem with running python plug-in examples. I added the search path in idf, and it can be run success in EP-lunch, but the result seems error. it only have 1/21 and 7/21's result, but the RunPeriod was set as whole year to tun.

ZhihuaCHEN's avatar ZhihuaCHEN (2021-01-18 21:04:38 -0500) edit
add a comment see more comments
0

I had the same issue in EP9.5. I had .py in the same folder as IDF file, but it could not find it using the default "Add Current Working Directory to Search Path" set to yes.

I think I found the cause of the issue. EnergyPlus removes the space from the "search paths" as a result he can't find the py module.

The original folder directory was "C:\Users\BT\Desktop\EnergyPlus95pythonexamples\test run"

The line from the .err file

*** Successfully added path "C:\\Users\\BT\\Desktop\\EnergyPlus95pythonexamples\\testrun" to the sys.path in Python
Tokarzewski's avatar
504
Tokarzewski
answered 2021-06-02 07:04:44 -0500, updated 2021-06-02 07:07:26 -0500
edit flag offensive 0 remove flag delete link

Comments

Search Paths do work. I must have made a mistake. *** Successfully added path "C:\Users\BT\Desktop\EnergyPlus95pythonexamples\test run" to the sys.path in Python

Tokarzewski's avatar Tokarzewski (2021-06-04 09:29:35 -0500) edit

Though, I can't run the python plugin without specifying search paths. I have "Add Current Working Directory to Search Path" and "Add Input File Directory to Search Path" both set with default values "yes". I am running tests on "PythonPluginCustomSchedule" from 9.5 example files.

Tokarzewski's avatar Tokarzewski (2021-06-04 09:49:08 -0500) edit
add a comment see more comments