Enable Frames in Mac Rhino

Is there away around the _getframe error on Mac as there is on Windows? I know this can be done in the Python editor settings in Windows but, as there is no built in editor on Mac, I’m at a loss for what to do.

Hi Jenna,

What _getframe error? Where are you getting the error? Do you have sample code we can run that reproduces the error?

– Dale

Hi Dale,

It happened when I was attempting to install the requests library. I’ve run in to a similar situation on Windows when installing numpy. It seems to be an IronPython configuration issue. The resolution for windows is outlined here.

Specifically, I believe the “Frames Enabled” option would get me past my current problem, but I don’t know how to enable it on Mac.

Message: 'module' object has no attribute '_getframe'

line 692, in exec_, "/Applications/Rhinoceros.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/requests/packages/urllib3/packages/six.py"
line 701, in <module>, "/Applications/Rhinoceros.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/requests/packages/urllib3/packages/six.py"
line 2, in <module>, "/Applications/Rhinoceros.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/requests/packages/urllib3/exceptions.py"
line 11, in <module>, "/Applications/Rhinoceros.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/requests/packages/urllib3/connectionpool.py"
line 8, in <module>, "/Applications/Rhinoceros.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/requests/packages/urllib3/__init__.py"
line 27, in <module>, "/Applications/Rhinoceros.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/requests/packages/__init__.py"
line 52, in <module>,     "/Applications/Rhinoceros.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/requests/__init__.py"
line 9, in <module>, "/Users/jennafizel/rhino/scripts/export_to_db.py"

If you’d like to try installing requests yourself, here’s what I’ve done so far:

cd /Applications/Rhinoceros.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/site-packages
sudo git clone git://github.com/kennethreitz/requests.git
cd requests
sudo python setup.py install

Then you’ll need to move the requests folder under build folder you just made with setup.py install up to /Applications/Rhinoceros.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib.

Then make any python file and include requests

import requests

I believe this should get you to my current error.

Hi Jenna,

I had one of my developers here try to reference ‘requests’ with frames enabled and he still couldn’t get the library to work. Perhaps this library just isn’t compatible with IronPython?

– Dale

Here’s another discussion where it was tried without success on Windows:

Hi Dale,

It’s quite possible that requests won’t work with IronPython/Rhino. I just got stuck on the frame issue. Is there any way for me to enable frames on Mac? While it looks like it’s not going to help with requests, I know on Windows it can make the difference between some libraries working or not.

I am stuck with the same issue. Still no solution to this problem?