3

Issues when importing eppy in Ghpython editor of Grasshopper

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
yiyuan-jia's avatar
218
yiyuan-jia
asked 2017-03-07 23:00:01 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2017-04-13 16:51:10 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

4

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

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

santoshphilip's avatar
961
santoshphilip
answered 2017-12-17 13:56:05 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
3

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.

Jamie Bull's avatar
5.1k
Jamie Bull
answered 2017-03-08 01:37:34 -0500, updated 2017-03-13 12:18:41 -0500
edit flag offensive 0 remove flag delete link

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
add a comment see more comments