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?
我正在尝试在我的python脚本中使用sympy库,但是当我尝试导入它时出现错误。我该如何解决?
1 个解决方案
#1
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.
您正在使用的库似乎使用内部API来获取当前堆栈/活动对象的信息。为了提供所需的信息和接口,您必须使用-X:FullFrames参数运行IronPython。
Should you plan on hosting IronPython from C# this answer explains the necessary steps.
如果您打算从C#托管IronPython,这个答案将解释必要的步骤。
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>
#1
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.
您正在使用的库似乎使用内部API来获取当前堆栈/活动对象的信息。为了提供所需的信息和接口,您必须使用-X:FullFrames参数运行IronPython。
Should you plan on hosting IronPython from C# this answer explains the necessary steps.
如果您打算从C#托管IronPython,这个答案将解释必要的步骤。
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>