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

python plugin for EnergyPlus issues

asked 4 years ago

ep_user's avatar

updated 4 years ago

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?

Preview: (hide)

3 Answers

Sort by » oldest newest most voted
3

answered 4 years ago

Mostafa Meimand's avatar

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!

Preview: (hide)
link
0

answered 4 years ago

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

Preview: (hide)
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  ( 4 years ago )
0

answered 3 years ago

Tokarzewski's avatar

updated 3 years ago

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
Preview: (hide)
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  ( 3 years ago )

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  ( 3 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

3 followers

Stats

Asked: 4 years ago

Seen: 1,189 times

Last updated: Jun 02 '21