I'm trying to use the sympy library in my python script, but I'm getting an error when I try to import it. How do I fix this?
Asked
Active
Viewed 441 times
1

Rahul
- 1,056
- 2
- 9
- 26
1 Answers
0
The library you are using seems to make use of an internal API to get information of the current stack/live objects.
In order to provide the required information and interfaces you have to run IronPython with the -X:FullFrames
argument.
Should you plan on hosting IronPython from C# this answer explains the necessary steps.
Instead of the previous situation/error
C:\Program Files (x86)\IronPython 2.7>ipy
IronPython 2.7.5 (2.7.5.0) on .NET 4.0.30319.42000 (32-bit)
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys._getframe(0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute '_getframe'
you will get the expected behavior
C:\Program Files (x86)\IronPython 2.7>ipy -X:FullFrames
IronPython 2.7.5 (2.7.5.0) on .NET 4.0.30319.42000 (32-bit)
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys._getframe(0)
<frame object at 0x000000000000002B>

Community
- 1
- 1

Simon Opelt
- 6,136
- 2
- 35
- 66
-
I get the following error on running ipy with -X:FullFrames: http://imgur.com/6vA8LfB – Rahul Sep 26 '15 at 13:37
-
Is [this question](http://stackoverflow.com/questions/29683868/c-ironpython-and-sympy-unicode-escape-decode-takes-no-arguments) related? – Simon Opelt Sep 26 '15 at 13:44