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

Issues when importing eppy in Ghpython editor of Grasshopper

asked 2017-03-07 23:00:01 -0500

updated 2017-04-13 16:51:10 -0500

I was trying to import Eppy package in the Ghpython editor in Grasshopper. Got this error:

 Runtime error (MissingMemberException): 'module' object has no attribute '_getframe'"

I also found this thread posted earlier which shows the same error:

Has anyone succeeded importing eppy in Ghpython/Grasshopper?


There is a check box under EditPythonScript ->Tools -> Options -> Script Engine, where one can check "Frames Enabled".

It seems working well afterward to import eppyin the ghpython editor, however, I still can't import "modeleditor" under eppy, when I do from eppy import modeleditor, the error shows:

Runtime error (InvalidOperationException): Unsupported param dictionary type: IronPython.Runtime.PythonDictionary
Traceback:
  line 44, in initpkg, "C:\Python27\Lib\site-packages\py\_apipkg.py"
  line 19, in <module>, "C:\Python27\Lib\site-packages\py\__init__.py"
  line 24, in <module>, "C:\Python27\Lib\site-packages\eppy\modeleditor.py"
  line 4, in script
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2017-03-08 01:37:34 -0500

updated 2017-03-13 12:18:41 -0500

I have never used Grasshopper, but following the thread you linked to, there is a response to it being reported on on the grasshopper github page that may be useful:

There is an option in the python script editor "EditPythonScript" options dialog that allows for turning frames on. This should globally affect the entire python system in Rhino and will probably turn frames of (sic - I assume they mean "turn frames on") for ghPython scripts. Not very obvious, but the option is there.

Beyond that, there were also a couple of things in the Eppy codebase which were not compatible with IronPython. These have been resolved in the development branch and should be in the next release of Eppy.

edit flag offensive delete link more

Comments

Thanks for the heads-up. There is a check box under EditPythonScript ->Tools -> Options -> Script Engine, where one can check "Frames Enabled". It seems working well afterward to import eppy, however, I still can't import "modeleditor" under eppy, please see the updated post for the error code. Thanks in advance!

yiyuan-jia's avatar yiyuan-jia  ( 2017-03-09 16:53:45 -0500 )edit

What is line 24 in your version of eppy.modeleditor? Is it from six import iteritems?

Jamie Bull's avatar Jamie Bull  ( 2017-03-09 17:12:56 -0500 )edit

line 24 is from py._log import warning

yiyuan-jia's avatar yiyuan-jia  ( 2017-03-10 09:04:50 -0500 )edit

What version of eppy is that? Have you tried with the latest, 0.5.43? No reason to expect it would be different but it would be useful to be on the same page.

Jamie Bull's avatar Jamie Bull  ( 2017-03-10 09:24:24 -0500 )edit

I just upgraded to the newest version. Now it's reporting line 22, which is also from py._log import warning.

yiyuan-jia's avatar yiyuan-jia  ( 2017-03-10 09:41:27 -0500 )edit
4

answered 2017-12-17 13:56:05 -0500

santoshphilip's avatar

@MahmoudAbdelRahman has written a CPython plugin that allows you to run eppy on grasshopper.

This plugin is at https://github.com/MahmoudAbdelRahman/GH_CPython

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

Careers

Question Tools

2 followers

Stats

Asked: 2017-03-07 23:00:01 -0500

Seen: 535 times

Last updated: Dec 17 '17