当我在正常的sage.all
shell上使用python
模块时,sage.all
会在运行方法{{>}时抛出错误 1}}或solve
:
assume
在>>> 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.
shell(和预处理器)上运行assume
或solve
的工作方式与预期相同。
如何才能让sage
在sage.all
上正常使用?
谢谢 - 如果我的问题有任何不清楚的地方,请发表评论。
答案 0 :(得分: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]: