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

python plugin for EnergyPlus issues

asked 2020-12-28 10:30:37 -0500

ep_user gravatar image

updated 2021-01-04 03:13:27 -0500

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?

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
2

answered 2021-01-03 18:55:05 -0500

Mostafa Meimand gravatar image

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!

edit flag offensive delete link more
0

answered 2021-06-02 07:04:44 -0500

Tokarzewski gravatar image

updated 2021-06-02 07:07:26 -0500

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
edit flag offensive delete link more

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 gravatar image 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 gravatar image Tokarzewski  ( 2021-06-04 09:49:08 -0500 )edit
0

answered 2021-01-04 03:17:39 -0500

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

edit flag offensive delete link more
0

answered 2021-01-18 21:04:38 -0500

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.

edit flag offensive delete link more

Your Answer

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

Add Answer

 

Question Tools

2 followers

Stats

Asked: 2020-12-28 10:28:54 -0500

Seen: 228 times

Last updated: Jun 02