1

我的情况

当我在普通shell上使用sage.all模块时,会在运行方法时引发错误,例如orpythonsage.allsolveassume

>>> import sage.all as sg;a=sg.var('a');sg.assume(a==0);
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/sage/local/lib/python2.7/site-packages/sage/symbolic/assumptions.py", line 412, in assume
    x.assume()
  File "expression.pyx", line 1397, in sage.symbolic.expression.Expression.assume (sage/symbolic/expression.cpp:8428)
  File "lazy_import.pyx", line 212, in sage.misc.lazy_import.LazyImport.__getattr__ (sage/misc/lazy_import.c:1865)
  File "lazy_import.pyx", line 148, in sage.misc.lazy_import.LazyImport._get_object (sage/misc/lazy_import.c:1268)
  File "/opt/sage/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 153, in <module>
    ecl_eval("#$%s$"%l)
  File "ecl.pyx", line 1236, in sage.libs.ecl.ecl_eval (sage/libs/ecl.c:7040)
  File "ecl.pyx", line 1251, in sage.libs.ecl.ecl_eval (sage/libs/ecl.c:6977)
  File "ecl.pyx", line 257, in sage.libs.ecl.ecl_safe_eval (sage/libs/ecl.c:2839)
RuntimeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined.

运行assumesolvesage外壳(和预处理器)上运行就像它应该做的那样。

我的问题

我该怎么做才能sage.all正常工作python

谢谢 - 如果我的问题有任何不清楚的地方,请发表评论。

4

1 回答 1

3

我只会使用 IPython shell 的 Sage 副本。

$ sage -ipython
Python 2.7.3 (default, Feb 16 2013, 21:48:36) 
Type "copyright", "credits" or "license" for more information.
IPython 0.13.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import sage.all as sg

In [2]: a = sg.var('a')

In [3]: sg.assume(a==0)

In [4]: 
于 2013-03-05T02:34:04.393 回答