*************************************************************************** IPython post-mortem report {'commit_hash': u'', 'commit_source': '(none found)', 'default_encoding': 'UTF-8', 'ipython_path': '/usr/lib/python2.7/site-packages/IPython', 'ipython_version': '5.3.0', 'os_name': 'posix', 'platform': 'Linux-4.11.5-1-ARCH-x86_64-with-glibc2.2.5', 'sys_executable': '/bin/python2', 'sys_platform': 'linux2', 'sys_version': '2.7.13 (default, Feb 11 2017, 12:22:40) \n[GCC 6.3.1 20170109]'} *************************************************************************** *************************************************************************** Crash traceback: --------------------------------------------------------------------------- --------------------------------------------------------------------------- RuntimeError Python 2.7.13: /bin/python2 Thu Jun 15 17:10:39 2017 A problem occurred executing Python code. Here is the sequence of function calls leading up to the error, with the most recent (innermost) call last. /bin/sage-ipython in () 1 #!/usr/bin/env python2 2 # -*- coding: utf-8 -*- 3 """ 4 Sage IPython startup script. 5 """ 6 7 from sage.repl.interpreter import SageTerminalApp 8 9 app = SageTerminalApp.instance() ---> 10 app.initialize() global app.initialize = > 11 app.start() in initialize(self=, argv=None) /usr/lib/python2.7/site-packages/traitlets/config/application.pyc in catch_config_error(method=, app=, *args=(None,), **kwargs={}) 72 TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR = False 73 else: 74 raise ValueError("Unsupported value for environment variable: 'TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR' is set to '%s' which is none of {'0', '1', 'false', 'true', ''}."% _envvar ) 75 76 77 @decorator 78 def catch_config_error(method, app, *args, **kwargs): 79 """Method decorator for catching invalid config (Trait/ArgumentErrors) during init. 80 81 On a TraitError (generally caused by bad config), this will print the trait's 82 message, and exit the app. 83 84 For use on init methods, to prevent invoking excepthook on invalid input. 85 """ 86 try: ---> 87 return method(app, *args, **kwargs) method = app = args = (None,) kwargs = {} 88 except (TraitError, ArgumentError) as e: 89 app.print_help() 90 app.log.fatal("Bad config encountered during initialization:") 91 app.log.fatal(str(e)) 92 app.log.debug("Config at the time: %s", app.config) 93 app.exit(1) 94 95 96 class ApplicationError(Exception): 97 pass 98 99 100 class LevelFormatter(logging.Formatter): 101 """Formatter with additional `highlevel` record 102 /usr/lib/python2.7/site-packages/IPython/terminal/ipapp.pyc in initialize(self=, argv=None) 294 295 return super(TerminalIPythonApp, self).parse_command_line(argv) 296 297 @catch_config_error 298 def initialize(self, argv=None): 299 """Do actions after construct, but before starting the app.""" 300 super(TerminalIPythonApp, self).initialize(argv) 301 if self.subapp is not None: 302 # don't bother initializing further, starting subapp 303 return 304 # print self.extra_args 305 if self.extra_args and not self.something_to_run: 306 self.file_to_run = self.extra_args[0] 307 self.init_path() 308 # create the shell --> 309 self.init_shell() self.init_shell = > 310 # and draw the banner 311 self.init_banner() 312 # Now a variety of things that happen after the banner is printed. 313 self.init_gui_pylab() 314 self.init_extensions() 315 self.init_code() 316 317 def init_shell(self): 318 """initialize the InteractiveShell instance""" 319 # Create an InteractiveShell instance. 320 # shell.display_banner should always be False for the terminal 321 # based app, because we call shell.show_banner() by hand below 322 # so the banner shows *before* all extension loading stuff. 323 self.shell = TerminalInteractiveShell.instance(parent=self, 324 profile_dir=self.profile_dir, /usr/lib/python2.7/site-packages/sage/repl/interpreter.pyc in init_shell(self=) 747 self.shell.has_sage_extensions = SAGE_EXTENSION in self.extensions 748 749 # Load the %lprun extension if available 750 try: 751 import line_profiler 752 except ImportError: 753 pass 754 else: 755 self.extensions.append('line_profiler') 756 757 if self.shell.has_sage_extensions: 758 self.extensions.remove(SAGE_EXTENSION) 759 760 # load sage extension here to get a crash if 761 # something is wrong with the sage library --> 762 self.shell.extension_manager.load_extension(SAGE_EXTENSION) self.shell.extension_manager.load_extension = > global SAGE_EXTENSION = 'sage' 763 764 /usr/lib/python2.7/site-packages/IPython/core/extensions.pyc in load_extension(self=, module_str='sage') 70 71 Returns the string "already loaded" if the extension is already loaded, 72 "no load function" if the module doesn't have a load_ipython_extension 73 function, or None if it succeeded. 74 """ 75 if module_str in self.loaded: 76 return "already loaded" 77 78 from IPython.utils.syspathcontext import prepended_to_syspath 79 80 with self.shell.builtin_trap: 81 if module_str not in sys.modules: 82 with prepended_to_syspath(self.ipython_extension_dir): 83 __import__(module_str) 84 mod = sys.modules[module_str] ---> 85 if self._call_load_ipython_extension(mod): self._call_load_ipython_extension = > mod = 86 self.loaded.add(module_str) 87 else: 88 return "no load function" 89 90 def unload_extension(self, module_str): 91 """Unload an IPython extension by its module name. 92 93 This function looks up the extension's name in ``sys.modules`` and 94 simply calls ``mod.unload_ipython_extension(self)``. 95 96 Returns the string "no unload function" if the extension doesn't define 97 a function to unload itself, "not loaded" if the extension isn't loaded, 98 otherwise None. 99 """ 100 if module_str not in self.loaded: /usr/lib/python2.7/site-packages/IPython/core/extensions.pyc in _call_load_ipython_extension(self=, mod=) 117 """ 118 from IPython.utils.syspathcontext import prepended_to_syspath 119 120 if (module_str in self.loaded) and (module_str in sys.modules): 121 self.unload_extension(module_str) 122 mod = sys.modules[module_str] 123 with prepended_to_syspath(self.ipython_extension_dir): 124 reload(mod) 125 if self._call_load_ipython_extension(mod): 126 self.loaded.add(module_str) 127 else: 128 self.load_extension(module_str) 129 130 def _call_load_ipython_extension(self, mod): 131 if hasattr(mod, 'load_ipython_extension'): --> 132 mod.load_ipython_extension(self.shell) mod.load_ipython_extension = self.shell = 133 return True 134 135 def _call_unload_ipython_extension(self, mod): 136 if hasattr(mod, 'unload_ipython_extension'): 137 mod.unload_ipython_extension(self.shell) 138 return True 139 140 def install_extension(self, url, filename=None): 141 """Download and install an IPython extension. 142 143 If filename is given, the file will be so named (inside the extension 144 directory). Otherwise, the name from the URL will be used. The file must 145 have a .py or .zip extension; otherwise, a ValueError will be raised. 146 147 Returns the full path to the installed file. /usr/lib/python2.7/site-packages/sage/__init__.pyc in load_ipython_extension(*args=(,)) 1 __all__ = ['all'] 2 3 # IPython calls this when starting up 4 def load_ipython_extension(*args): 5 import sage.repl.ipython_extension ----> 6 sage.repl.ipython_extension.load_ipython_extension(*args) sage.repl.ipython_extension.load_ipython_extension = args = (,) /usr/lib/python2.7/site-packages/sage/repl/ipython_extension.pyc in wrapper(*args=(,), **kwargs={}) 490 ....: if work: 491 ....: return 'foo worked' 492 ....: raise RuntimeError("foo didn't work") 493 sage: foo(False) 494 Traceback (most recent call last): 495 ... 496 RuntimeError: foo didn't work 497 sage: foo(True) 498 'foo worked' 499 sage: foo(False) 500 sage: foo(True) 501 """ 502 @wraps(func) 503 def wrapper(*args, **kwargs): 504 if not wrapper.has_run: --> 505 result = func(*args, **kwargs) result = undefined global func = undefined args = (,) kwargs = {} 506 wrapper.has_run = True 507 return result 508 wrapper.has_run = False 509 return wrapper 510 511 512 @run_once 513 def load_ipython_extension(ip): 514 """ 515 Load the extension in IPython. 516 """ 517 # this modifies ip 518 SageCustomizations(shell=ip) /usr/lib/python2.7/site-packages/sage/repl/ipython_extension.pyc in load_ipython_extension(ip=) 503 def wrapper(*args, **kwargs): 504 if not wrapper.has_run: 505 result = func(*args, **kwargs) 506 wrapper.has_run = True 507 return result 508 wrapper.has_run = False 509 return wrapper 510 511 512 @run_once 513 def load_ipython_extension(ip): 514 """ 515 Load the extension in IPython. 516 """ 517 # this modifies ip --> 518 SageCustomizations(shell=ip) global SageCustomizations = global shell = undefined ip = /usr/lib/python2.7/site-packages/sage/repl/ipython_extension.pyc in __init__(self=, shell=) 361 def __init__(self, shell=None): 362 """ 363 Initialize the Sage plugin. 364 """ 365 self.shell = shell 366 367 self.auto_magics = SageMagics(shell) 368 self.shell.register_magics(self.auto_magics) 369 370 import sage.misc.edit_module as edit_module 371 self.shell.set_hook('editor', edit_module.edit_devel) 372 373 self.init_inspector() 374 self.init_line_transforms() 375 --> 376 import sage.all # until sage's import hell is fixed sage.all = undefined 377 378 self.shell.verbose_quit = True 379 self.set_quit_hook() 380 381 self.register_interface_magics() 382 383 if SAGE_IMPORTALL == 'yes': 384 self.init_environment() 385 386 def register_interface_magics(self): 387 """ 388 Register magics for each of the Sage interfaces 389 """ 390 from sage.repl.interface_magic import InterfaceMagic 391 InterfaceMagic.register_all(self.shell) /usr/lib/python2.7/site-packages/sage/all.py in () 77 78 # Add SAGE_SRC at the end of sys.path to enable Cython tracebacks 79 # (which use paths relative to SAGE_SRC) 80 sys.path.append(SAGE_SRC) 81 82 83 ################################################################### 84 85 # This import also setups the interrupt handler 86 from cysignals.signals import (AlarmInterrupt, SignalError, 87 sig_on_reset as sig_on_count) 88 89 from time import sleep 90 91 import sage.misc.lazy_import ---> 92 from sage.misc.all import * # takes a while global sage.misc.all = undefined 93 from sage.typeset.all import * 94 from sage.repl.all import * 95 96 from sage.misc.sh import sh 97 98 from sage.libs.all import * 99 from sage.data_structures.all import * 100 from sage.doctest.all import * 101 102 from sage.structure.all import * 103 from sage.rings.all import * 104 from sage.arith.all import * 105 from sage.matrix.all import * 106 107 from sage.symbolic.all import * /usr/lib/python2.7/site-packages/sage/misc/all.py in () 73 74 from .defaults import (set_default_variable_name, 75 series_precision, set_series_precision) 76 77 from .sage_eval import sage_eval, sageobj 78 79 from .sage_input import sage_input 80 81 lazy_import("sage.misc.cython", ["cython_lambda", "cython_create_local_so"]) 82 lazy_import("sage.misc.cython_c", "cython_compile", "cython") 83 84 from .persist import save, load, dumps, loads, db, db_save 85 86 from .func_persist import func_persist 87 ---> 88 from .functional import (additive_order, global functional = undefined global additive_order = undefined global base_ring = undefined global base_field = undefined global basis = undefined global category = undefined global charpoly = undefined global characteristic_polynomial = undefined global coerce = undefined global cyclotomic_polynomial = undefined global decomposition = undefined global denominator = undefined global det = undefined global dimension = undefined global dim = undefined global discriminant = undefined global disc = undefined global eta = undefined global fcp = undefined global gen = undefined global gens = undefined global hecke_operator = undefined global image = undefined global integral = undefined global integrate = undefined global integral_closure = undefined global interval = undefined global xinterval = undefined global is_commutative = undefined global is_even = undefined global is_integrally_closed = undefined global is_field = undefined global is_odd = undefined global kernel = undefined global krull_dimension = undefined global lift = undefined global log = undefined global log_b = undefined global minimal_polynomial = undefined global minpoly = undefined global multiplicative_order = undefined global ngens = undefined global norm = undefined global numerator = undefined global numerical_approx = undefined global n = undefined global N = undefined global objgens = undefined global objgen = undefined global order = undefined global rank = undefined global regulator = undefined global round = undefined global quotient = undefined global quo = undefined global isqrt = undefined global squarefree_part = undefined global symbolic_sum = undefined global sum = undefined global transpose = undefined 89 base_ring, 90 base_field, 91 basis, 92 category, 93 charpoly, 94 characteristic_polynomial, 95 coerce, 96 cyclotomic_polynomial, 97 decomposition, 98 denominator, 99 det, 100 dimension, 101 dim, 102 discriminant, 103 disc, /usr/lib/python2.7/site-packages/sage/misc/functional.py in () 17 # 18 # This program is free software: you can redistribute it and/or modify 19 # it under the terms of the GNU General Public License as published by 20 # the Free Software Foundation, either version 2 of the License, or 21 # (at your option) any later version. 22 # http://www.gnu.org/licenses/ 23 #***************************************************************************** 24 from __future__ import absolute_import 25 from six.moves import range 26 from six.moves import builtins 27 28 import sage.misc.latex 29 import sage.interfaces.expect 30 import sage.interfaces.mathematica 31 ---> 32 from sage.rings.complex_double import CDF global sage.rings.complex_double = undefined global CDF = undefined 33 from sage.rings.real_double import RDF, RealDoubleElement 34 35 import sage.rings.real_mpfr 36 import sage.rings.complex_field 37 import sage.rings.integer 38 39 ############################################################################## 40 # There are many functions on elements of a ring, which mathematicians 41 # usually write f(x), e.g., it is weird to write x.log() and natural 42 # to write log(x). The functions below allow for the more familiar syntax. 43 ############################################################################## 44 def additive_order(x): 45 """ 46 Returns the additive order of `x`. 47 sage/rings/complex_double.pyx in init sage.rings.complex_double (/build/sagemath/src/sage-7.6/src/src/build/cythonized/sage/rings/complex_double.c:24162)() /usr/lib/python2.7/site-packages/sage/rings/complex_field.pyc in ComplexField(prec=53, names=None) 99 Complex Field with 53 bits of precision 100 sage: ComplexField(100) 101 Complex Field with 100 bits of precision 102 sage: ComplexField(100).base_ring() 103 Real Field with 100 bits of precision 104 sage: i = ComplexField(200).gen() 105 sage: i^2 106 -1.0000000000000000000000000000000000000000000000000000000000 107 """ 108 global cache 109 if prec in cache: 110 X = cache[prec] 111 C = X() 112 if not C is None: 113 return C --> 114 C = ComplexField_class(prec) C = undefined global ComplexField_class = prec = 53 115 cache[prec] = weakref.ref(C) 116 return C 117 118 119 class ComplexField_class(ring.Field): 120 """ 121 An approximation to the field of complex numbers using floating 122 point numbers with any specified precision. Answers derived from 123 calculations in this approximation may differ from what they would 124 be if those calculations were performed in the true field of 125 complex numbers. This is due to the rounding errors inherent to 126 finite precision calculations. 127 128 EXAMPLES:: 129 /usr/lib/python2.7/site-packages/sage/rings/complex_field.pyc in __init__(self=Complex Field with 53 bits of precision, prec=53) 193 def __init__(self, prec=53): 194 """ 195 Initialize ``self``. 196 197 TESTS:: 198 199 sage: C = ComplexField(200) 200 sage: C.category() 201 Join of Category of fields and Category of complete metric spaces 202 sage: TestSuite(C).run() 203 """ 204 self._prec = int(prec) 205 from sage.categories.fields import Fields 206 ParentWithGens.__init__(self, self._real_field(), ('I',), False, category=Fields().Metric().Complete()) 207 # self._populate_coercion_lists_() --> 208 self._populate_coercion_lists_(coerce_list=[RRtoCC(self._real_field(), self)]) self._populate_coercion_lists_ = global coerce_list = undefined global RRtoCC = self._real_field = self = Complex Field with 53 bits of precision 209 210 def __reduce__(self): 211 """ 212 For pickling. 213 214 EXAMPLES:: 215 216 sage: loads(dumps(ComplexField())) == ComplexField() 217 True 218 """ 219 return ComplexField, (self._prec, ) 220 221 def is_exact(self): 222 """ 223 Return whether or not this field is exact, which is always ``False``. sage/rings/complex_number.pyx in sage.rings.complex_number.RRtoCC.__init__ (/build/sagemath/src/sage-7.6/src/src/build/cythonized/sage/rings/complex_number.c:21686)() sage/categories/map.pyx in sage.categories.map.Map.__init__ (/build/sagemath/src/sage-7.6/src/src/build/cythonized/sage/categories/map.c:3436)() /usr/lib/python2.7/site-packages/sage/categories/homset.pyc in Hom(X=Real Field with 53 bits of precision, Y=Complex Field with 53 bits of precision, category=Join of Category of fields and Category of complete metric spaces, check=True) 354 key = (X,Y,category) 355 try: 356 H = _cache[key] 357 except KeyError: 358 H = None 359 if H is not None: 360 # Return H unless the domain or codomain breaks the unique parent condition 361 if H.domain() is X and H.codomain() is Y: 362 return H 363 364 # Determines the category 365 if category is None: 366 category = X.category()._meet_(Y.category()) 367 # Recurse to make sure that Hom(X, Y) and Hom(X, Y, category) are identical 368 # No need to check the input again --> 369 H = Hom(X, Y, category, check=False) H = None global Hom = X = Real Field with 53 bits of precision Y = Complex Field with 53 bits of precision category = Join of Category of fields and Category of complete metric spaces check = True global False = undefined 370 else: 371 if check: 372 if not isinstance(category, Category): 373 raise TypeError("Argument category (= {}) must be a category.".format(category)) 374 for O in [X, Y]: 375 try: 376 category_mismatch = O not in category 377 except Exception: 378 # An error should not happen, this here is just to be on 379 # the safe side. 380 category_mismatch = True 381 # A category mismatch does not necessarily mean that an error 382 # should be raised. Instead, it could be the case that we are 383 # unpickling an old pickle (that doesn't set the "check" 384 # argument to False). In this case, it could be that the /usr/lib/python2.7/site-packages/sage/categories/homset.pyc in Hom(X=Real Field with 53 bits of precision, Y=Complex Field with 53 bits of precision, category=Join of Category of fields and Category of complete metric spaces, check=False) 381 # A category mismatch does not necessarily mean that an error 382 # should be raised. Instead, it could be the case that we are 383 # unpickling an old pickle (that doesn't set the "check" 384 # argument to False). In this case, it could be that the 385 # (co)domain is not properly initialised, which we are 386 # checking now. See trac #16275 and #14793. 387 if category_mismatch and O._is_category_initialized(): 388 # At this point, we can be rather sure that O is properly 389 # initialised, and thus its string representation is 390 # available for the following error message. It simply 391 # belongs to the wrong category. 392 raise ValueError("{} is not in {}".format(O, category)) 393 394 # Construct H 395 try: # _Hom_ hook from the parent --> 396 H = X._Hom_(Y, category) H = None X._Hom_ = Y = Complex Field with 53 bits of precision category = Join of Category of fields and Category of complete metric spaces 397 except (AttributeError, TypeError): 398 try: 399 # Workaround in case the above fails, but the category 400 # also provides a _Hom_ hook. 401 # FIXME: 402 # - If X._Hom_ actually comes from category and fails, it 403 # will be called twice. 404 # - This is bound to fail if X is an extension type and 405 # does not actually inherit from category.parent_class 406 H = category.parent_class._Hom_(X, Y, category = category) 407 except (AttributeError, TypeError): 408 # By default, construct a plain homset. 409 H = Homset(X, Y, category = category, check=check) 410 _cache[key] = H 411 if isinstance(X, UniqueRepresentation) and isinstance(Y, UniqueRepresentation): /usr/lib/python2.7/site-packages/sage/categories/rings.pyc in _Hom_(self=Real Field with 53 bits of precision, Y=Complex Field with 53 bits of precision, category=Join of Category of fields and Category of complete metric spaces) 209 TESTS:: 210 211 sage: Hom(QQ, QQ, category = Rings()).__class__ 212 213 214 sage: Hom(CyclotomicField(3), QQ, category = Rings()).__class__ 215 216 217 sage: TestSuite(Hom(QQ, QQ, category = Rings())).run() # indirect doctest 218 219 """ 220 if category is not None and not category.is_subcategory(Rings()): 221 raise TypeError("%s is not a subcategory of Rings()"%category) 222 if Y not in Rings(): 223 raise TypeError("%s is not a ring"%Y) --> 224 from sage.rings.homset import RingHomset global sage.rings.homset = undefined RingHomset = undefined 225 return RingHomset(self, Y, category = category) 226 227 # this is already in sage.rings.ring.Ring, 228 # but not all rings descend from that class, 229 # e.g., matrix spaces. 230 def _mul_(self, x, switch_sides=False): 231 """ 232 Multiplication of rings with, e.g., lists. 233 234 NOTE: 235 236 This method is used to create ideals. It is 237 the same as the multiplication method for 238 :class:`~sage.rings.ring.Ring`. However, not 239 all parents that belong to the category of /usr/lib/python2.7/site-packages/sage/rings/homset.pyc in () 4 5 #***************************************************************************** 6 # Copyright (C) 2006 William Stein 7 # 8 # Distributed under the terms of the GNU General Public License (GPL) 9 # 10 # http://www.gnu.org/licenses/ 11 #***************************************************************************** 12 from __future__ import absolute_import 13 14 from sage.categories.homset import HomsetWithBase 15 from sage.categories.rings import Rings 16 _Rings = Rings() 17 18 from . import morphism ---> 19 from . import quotient_ring global quotient_ring = undefined 20 21 def is_RingHomset(H): 22 """ 23 Return ``True`` if ``H`` is a space of homomorphisms between two rings. 24 25 EXAMPLES:: 26 27 sage: from sage.rings.homset import is_RingHomset as is_RH 28 sage: is_RH(Hom(ZZ, QQ)) 29 True 30 sage: is_RH(ZZ) 31 False 32 sage: is_RH(Hom(RR, CC)) 33 True 34 sage: is_RH(Hom(FreeModule(ZZ,1), FreeModule(QQ,1))) /usr/lib/python2.7/site-packages/sage/rings/quotient_ring.py in () 100 """ 101 #***************************************************************************** 102 # Copyright (C) 2005 William Stein 103 # 104 # This program is free software: you can redistribute it and/or modify 105 # it under the terms of the GNU General Public License as published by 106 # the Free Software Foundation, either version 2 of the License, or 107 # (at your option) any later version. 108 # http://www.gnu.org/licenses/ 109 #***************************************************************************** 110 from __future__ import absolute_import 111 from six.moves import range 112 113 import sage.misc.latex as latex 114 from . import ring, ideal, quotient_ring_element --> 115 import sage.rings.polynomial.multi_polynomial_ideal global sage.rings.polynomial.multi_polynomial_ideal = undefined 116 from sage.structure.category_object import normalize_names 117 import sage.structure.parent_gens 118 from sage.interfaces.singular import singular as singular_default, is_SingularElement 119 from sage.misc.cachefunc import cached_method 120 from sage.categories.rings import Rings 121 from sage.categories.commutative_rings import CommutativeRings 122 123 def QuotientRing(R, I, names=None): 124 r""" 125 Creates a quotient ring of the ring `R` by the twosided ideal `I`. 126 127 Variables are labeled by ``names`` (if the quotient ring is a quotient 128 of a polynomial ring). If ``names`` isn't given, 'bar' will be appended 129 to the variable names in `R`. 130 /usr/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.py in () 224 # Distributed under the terms of the GNU General Public License (GPL) 225 # 226 # This code is distributed in the hope that it will be useful, 227 # but WITHOUT ANY WARRANTY; without even the implied warranty of 228 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 229 # General Public License for more details. 230 # 231 # The full text of the GPL is available at: 232 # 233 # http://www.gnu.org/licenses/ 234 #***************************************************************************** 235 from __future__ import print_function 236 import six 237 from six.moves import range 238 --> 239 from sage.interfaces.all import (singular as singular_default, global sage.interfaces.all = undefined global singular = undefined global singular_default = undefined global macaulay2 = undefined global macaulay2_default = undefined global magma = undefined global magma_default = undefined 240 macaulay2 as macaulay2_default, 241 magma as magma_default) 242 243 from sage.interfaces.expect import StdOutContext 244 245 from sage.rings.ideal import Ideal_generic 246 from sage.rings.noncommutative_ideals import Ideal_nc 247 from sage.rings.integer import Integer 248 from sage.structure.sequence import Sequence 249 250 from sage.misc.cachefunc import cached_method 251 from sage.misc.all import prod, verbose, get_verbose 252 from sage.misc.method_decorator import MethodDecorator 253 254 from sage.rings.integer_ring import ZZ /usr/lib/python2.7/site-packages/sage/interfaces/all.py in () 9 from .fricas import FriCAS, fricas 10 11 from .gap import gap, gap_reset_workspace, set_gap_memory_pool_size, Gap 12 from .gap3 import gap3, gap3_version, Gap3 13 lazy_import('sage.interfaces.genus2reduction', ['genus2reduction', 'Genus2reduction']) 14 from .gfan import gfan, Gfan 15 from .giac import giac, Giac 16 from .gp import gp, gp_version, Gp 17 from .gnuplot import gnuplot 18 from .kash import kash, kash_version, Kash 19 from .lisp import lisp, Lisp 20 from .magma import magma, magma_version, Magma 21 from .magma_free import magma_free 22 from .macaulay2 import macaulay2, Macaulay2 23 from .maple import maple, Maple ---> 24 from .maxima import maxima, Maxima global maxima = undefined global Maxima = undefined 25 # import problems 26 #from maxima_lib import maxima_lib 27 from .mathematica import mathematica, Mathematica 28 from .matlab import matlab, matlab_version, Matlab 29 from .mupad import mupad, Mupad # NOT functional yet 30 from .mwrank import mwrank, Mwrank 31 from .octave import octave, octave_version, Octave 32 from .qepcad import qepcad, qepcad_version, qepcad_formula 33 from .qsieve import qsieve 34 from .singular import singular, singular_version, Singular 35 from .sage0 import sage0 as sage0, sage0_version, Sage 36 from .scilab import scilab 37 from .tachyon import tachyon_rt 38 from .psage import PSage 39 from .ecm import ECM, ecm /usr/lib/python2.7/site-packages/sage/interfaces/maxima.py in () 1239 1240 sage: m = Maxima() 1241 sage: g = m.function('x,y','x+y^9') 1242 sage: h = loads(dumps(g)) 1243 sage: g.parent() == h.parent() 1244 False 1245 """ 1246 MaximaElement.__init__(self, parent, name, is_name=True) 1247 MaximaAbstractElementFunction.__init__(self, parent, 1248 name, defn, args, latex) 1249 1250 1251 # An instance 1252 maxima = Maxima(init_code = ['display2d : false', 1253 'domain : complex', 'keepfloat : true'], -> 1254 script_subdirectory=None) global script_subdirectory = undefined global None = undefined 1255 1256 1257 def reduce_load_Maxima(): #(init_code=None): 1258 """ 1259 Unpickle a Maxima Pexpect interface. 1260 1261 EXAMPLES:: 1262 1263 sage: from sage.interfaces.maxima import reduce_load_Maxima 1264 sage: reduce_load_Maxima() 1265 Maxima 1266 """ 1267 return maxima #Maxima(init_code=init_code) 1268 1269 # This is defined for compatibility with the old Maxima interface. /usr/lib/python2.7/site-packages/sage/interfaces/maxima.py in __init__(self= instance, script_subdirectory=None, logfile=None, server=None, init_code=['display2d : false', 'domain : complex', 'keepfloat : true']) 524 # setting inchar and outchar.. 525 eval_using_file_cutoff = 256 526 self.__eval_using_file_cutoff = eval_using_file_cutoff 527 STARTUP = os.path.join(SAGE_LOCAL,'bin','sage-maxima.lisp') 528 529 # We set maxima's configuration directory to $DOT_SAGE/maxima 530 # This avoids that sage's maxima inadvertently loads 531 # ~/.maxima/maxima-init.mac 532 # If you absolutely want maxima instances that are started by 533 # this interface to preload commands, put them in 534 # $DOT_SAGE/maxima/maxima-init.mac 535 # (we use the "--userdir" option in maxima for this) 536 SAGE_MAXIMA_DIR = os.path.join(DOT_SAGE,"maxima") 537 538 if not os.path.exists(STARTUP): --> 539 raise RuntimeError('You must get the file local/bin/sage-maxima.lisp') global RuntimeError = undefined 540 541 #self.__init_code = init_code 542 if init_code is None: 543 # display2d -- no ascii art output 544 # keepfloat -- don't automatically convert floats to rationals 545 init_code = ['display2d : false', 'keepfloat : true'] 546 547 # Turn off the prompt labels, since computing them *very 548 # dramatically* slows down the maxima interpret after a while. 549 # See the function makelabel in suprv1.lisp. 550 # Many thanks to andrej.vodopivec@gmail.com and also 551 # Robert Dodier for figuring this out! 552 # See trac # 6818. 553 init_code.append('nolabels : true') 554 RuntimeError: You must get the file local/bin/sage-maxima.lisp *************************************************************************** History of session input: *** Last line of input (may not be in above history):