*************************************************************************** IPython post-mortem report {'commit_hash': '3da1b22c25', 'commit_source': 'installation', 'default_encoding': 'utf-8', 'ipython_path': '/Applications/SageMath-9-5.app/Contents/Frameworks/Sage.framework/Versions/9.5/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/IPython', 'ipython_version': '7.29.0', 'os_name': 'posix', 'platform': 'macOS-12.1-arm64-arm-64bit', 'sys_executable': '/var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/bin/python3', 'sys_platform': 'darwin', 'sys_version': '3.9.9 (main, Jan 14 2022, 15:48:20) \n' '[Clang 13.0.0 (clang-1300.0.29.30)]'} *************************************************************************** *************************************************************************** Crash traceback: --------------------------------------------------------------------------- --------------------------------------------------------------------------- ImportErrorPython 3.9.9: /var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/bin/python3 Sun Jan 16 22:21:19 2022 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. /var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/bin/sage-ipython in 1 #!/var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/bin/python3 2 3 # -*- coding: utf-8 -*- 4 """ 5 Sage IPython startup script. 6 """ 7 8 # Display startup banner. Do this before anything else to give the user 9 # early feedback that Sage is starting. 10 from sage.misc.banner import banner 11 banner() 12 13 from sage.repl.interpreter import SageTerminalApp 14 15 app = SageTerminalApp.instance() ---> 16 app.initialize() global app.initialize = > 17 app.start() /var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/traitlets/config/application.py in inner(app=, *args=(), **kwargs={}) 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 def catch_config_error(method): 78 """Method decorator for catching invalid config (Trait/ArgumentErrors) during init. 79 80 On a TraitError (generally caused by bad config), this will print the trait's 81 message, and exit the app. 82 83 For use on init methods, to prevent invoking excepthook on invalid input. 84 """ 85 @functools.wraps(method) 86 def inner(app, *args, **kwargs): 87 try: ---> 88 return method(app, *args, **kwargs) global method = undefined app = args = () kwargs = {} 89 except (TraitError, ArgumentError) as e: 90 app.log.fatal("Bad config encountered during initialization: %s", e) 91 app.log.debug("Config at the time: %s", app.config) 92 app.exit(1) 93 94 return inner 95 96 class ApplicationError(Exception): 97 pass 98 99 100 class LevelFormatter(logging.Formatter): 101 """Formatter with additional `highlevel` record 102 103 This field is empty if log level is less than highlevel_limit, /var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/IPython/terminal/ipapp.py in initialize(self=, argv=None) 303 304 return super(TerminalIPythonApp, self).parse_command_line(argv) 305 306 @catch_config_error 307 def initialize(self, argv=None): 308 """Do actions after construct, but before starting the app.""" 309 super(TerminalIPythonApp, self).initialize(argv) 310 if self.subapp is not None: 311 # don't bother initializing further, starting subapp 312 return 313 # print self.extra_args 314 if self.extra_args and not self.something_to_run: 315 self.file_to_run = self.extra_args[0] 316 self.init_path() 317 # create the shell --> 318 self.init_shell() self.init_shell = > 319 # and draw the banner 320 self.init_banner() 321 # Now a variety of things that happen after the banner is printed. 322 self.init_gui_pylab() 323 self.init_extensions() 324 self.init_code() 325 326 def init_shell(self): 327 """initialize the InteractiveShell instance""" 328 # Create an InteractiveShell instance. 329 # shell.display_banner should always be False for the terminal 330 # based app, because we call shell.show_banner() by hand below 331 # so the banner shows *before* all extension loading stuff. 332 self.shell = self.interactive_shell_class.instance(parent=self, 333 profile_dir=self.profile_dir, /var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/repl/interpreter.py in init_shell(self=) 774 775 # Load the %lprun extension if available 776 try: 777 import line_profiler 778 assert line_profiler # silence pyflakes 779 except ImportError: 780 pass 781 else: 782 self.extensions.append('line_profiler') 783 784 if self.shell.has_sage_extensions: 785 self.extensions.remove(SAGE_EXTENSION) 786 787 # load sage extension here to get a crash if 788 # something is wrong with the sage library --> 789 self.shell.extension_manager.load_extension(SAGE_EXTENSION) self.shell.extension_manager.load_extension = > global SAGE_EXTENSION = 'sage' /var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/IPython/core/extensions.py in load_extension(self=, module_str='sage') 72 if module_str in self.loaded: 73 return "already loaded" 74 75 from IPython.utils.syspathcontext import prepended_to_syspath 76 77 with self.shell.builtin_trap: 78 if module_str not in sys.modules: 79 with prepended_to_syspath(self.ipython_extension_dir): 80 mod = import_module(module_str) 81 if mod.__file__.startswith(self.ipython_extension_dir): 82 print(("Loading extensions from {dir} is deprecated. " 83 "We recommend managing extensions like any " 84 "other Python packages, in site-packages.").format( 85 dir=compress_user(self.ipython_extension_dir))) 86 mod = sys.modules[module_str] ---> 87 if self._call_load_ipython_extension(mod): self._call_load_ipython_extension = > mod = 88 self.loaded.add(module_str) 89 else: 90 return "no load function" 91 92 def unload_extension(self, module_str): 93 """Unload an IPython extension by its module name. 94 95 This function looks up the extension's name in ``sys.modules`` and 96 simply calls ``mod.unload_ipython_extension(self)``. 97 98 Returns the string "no unload function" if the extension doesn't define 99 a function to unload itself, "not loaded" if the extension isn't loaded, 100 otherwise None. 101 """ 102 if module_str not in self.loaded: /var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/IPython/core/extensions.py in _call_load_ipython_extension(self=, mod=) 119 """ 120 from IPython.utils.syspathcontext import prepended_to_syspath 121 122 if (module_str in self.loaded) and (module_str in sys.modules): 123 self.unload_extension(module_str) 124 mod = sys.modules[module_str] 125 with prepended_to_syspath(self.ipython_extension_dir): 126 reload(mod) 127 if self._call_load_ipython_extension(mod): 128 self.loaded.add(module_str) 129 else: 130 self.load_extension(module_str) 131 132 def _call_load_ipython_extension(self, mod): 133 if hasattr(mod, 'load_ipython_extension'): --> 134 mod.load_ipython_extension(self.shell) mod.load_ipython_extension = self.shell = 135 return True 136 137 def _call_unload_ipython_extension(self, mod): 138 if hasattr(mod, 'unload_ipython_extension'): 139 mod.unload_ipython_extension(self.shell) 140 return True 141 142 @undoc 143 def install_extension(self, url, filename=None): 144 """ 145 Deprecated. 146 """ 147 # Ensure the extension directory exists 148 raise DeprecationWarning( 149 '`install_extension` and the `install_ext` magic have been deprecated since IPython 4.0' /var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/repl/__init__.py in load_ipython_extension(*args=(,)) 1 # IPython calls this when "%load_ext sage.repl" is used. 2 # The Sage application loads it when starting up. 3 def load_ipython_extension(*args): 4 import sage.repl.ipython_extension ----> 5 sage.repl.ipython_extension.load_ipython_extension(*args) sage.repl.ipython_extension.load_ipython_extension = args = (,) 6 7 8 # The above used to be in sage.__init__, allowing users to use "%load_ext sage". 9 # But we are clearing out the __init__.py file as a preparation for 10 # making sage a native namespace package. 11 # 12 # So we make "%load_ext sage" work by monkey-patching the function 13 # into the sage package upon importing sage.repl. 14 import sage 15 sage.load_ipython_extension = load_ipython_extension /var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/repl/ipython_extension.py in wrapper(*args=(,), **kwargs={}) 602 ....: if work: 603 ....: return 'foo worked' 604 ....: raise RuntimeError("foo didn't work") 605 sage: foo(False) 606 Traceback (most recent call last): 607 ... 608 RuntimeError: foo didn't work 609 sage: foo(True) 610 'foo worked' 611 sage: foo(False) 612 sage: foo(True) 613 """ 614 @wraps(func) 615 def wrapper(*args, **kwargs): 616 if not wrapper.has_run: --> 617 result = func(*args, **kwargs) result = undefined global func = undefined args = (,) kwargs = {} 618 wrapper.has_run = True 619 return result 620 wrapper.has_run = False 621 return wrapper 622 623 624 @run_once 625 def load_ipython_extension(ip): 626 """ 627 Load the extension in IPython. 628 """ 629 # this modifies ip 630 SageCustomizations(shell=ip) /var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/repl/ipython_extension.py in load_ipython_extension(ip=) 615 def wrapper(*args, **kwargs): 616 if not wrapper.has_run: 617 result = func(*args, **kwargs) 618 wrapper.has_run = True 619 return result 620 wrapper.has_run = False 621 return wrapper 622 623 624 @run_once 625 def load_ipython_extension(ip): 626 """ 627 Load the extension in IPython. 628 """ 629 # this modifies ip --> 630 SageCustomizations(shell=ip) global SageCustomizations = global shell = undefined ip = /var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/repl/ipython_extension.py in __init__(self=, shell=) 419 def __init__(self, shell=None): 420 """ 421 Initialize the Sage plugin. 422 """ 423 self.shell = shell 424 425 self.auto_magics = SageMagics(shell) 426 self.shell.register_magics(self.auto_magics) 427 428 import sage.misc.edit_module as edit_module 429 self.shell.set_hook('editor', edit_module.edit_devel) 430 431 self.init_inspector() 432 self.init_line_transforms() 433 --> 434 import sage.all # until sage's import hell is fixed sage.all = undefined 435 436 self.shell.verbose_quit = True 437 self.set_quit_hook() 438 439 self.register_interface_magics() 440 441 if SAGE_IMPORTALL == 'yes': 442 self.init_environment() 443 444 def register_interface_magics(self): 445 """ 446 Register magics for each of the Sage interfaces 447 """ 448 from sage.repl.interface_magic import InterfaceMagic 449 InterfaceMagic.register_all(self.shell) /var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/all.py in 105 106 from sage.env import SAGE_ROOT, SAGE_SRC, SAGE_DOC_SRC, SAGE_LOCAL, DOT_SAGE, SAGE_ENV 107 108 109 ################################################################### 110 111 # This import also sets up the interrupt handler 112 from cysignals.signals import (AlarmInterrupt, SignalError, 113 sig_on_reset as sig_on_count) 114 115 from time import sleep 116 from functools import reduce # in order to keep reduce in python3 117 118 import sage.misc.lazy_import 119 --> 120 from sage.misc.all import * # takes a while global sage.misc.all = undefined 121 from sage.typeset.all import * 122 from sage.repl.all import * 123 124 from sage.misc.sh import sh 125 126 from sage.libs.all import * 127 from sage.data_structures.all import * 128 from sage.doctest.all import * 129 130 from sage.structure.all import * 131 from sage.rings.all import * 132 from sage.arith.all import * 133 from sage.matrix.all import * 134 135 from sage.symbolic.all import * /var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/misc/all.py in 75 76 from .defaults import (set_default_variable_name, 77 series_precision, set_series_precision) 78 79 from .sage_eval import sage_eval, sageobj 80 81 from .sage_input import sage_input 82 83 lazy_import("sage.misc.cython", "cython_lambda") 84 lazy_import("sage.misc.cython", "cython_compile", "cython") 85 86 from .persist import save, load, dumps, loads, db, db_save 87 88 from .func_persist import func_persist 89 ---> 90 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 sqrt = undefined global symbolic_sum = undefined global sum = undefined global symbolic_prod = undefined global product = undefined global transpose = undefined 91 base_ring, 92 base_field, 93 basis, 94 category, 95 charpoly, 96 characteristic_polynomial, 97 coerce, 98 cyclotomic_polynomial, 99 decomposition, 100 denominator, 101 det, 102 dimension, 103 dim, 104 discriminant, 105 disc, /var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/misc/functional.py in 11 12 - David Joyner (2005-12-20): More Examples 13 """ 14 # **************************************************************************** 15 # Copyright (C) 2004 William Stein 16 # 17 # This program is free software: you can redistribute it and/or modify 18 # it under the terms of the GNU General Public License as published by 19 # the Free Software Foundation, either version 2 of the License, or 20 # (at your option) any later version. 21 # https://www.gnu.org/licenses/ 22 # **************************************************************************** 23 import builtins 24 import math 25 ---> 26 from sage.rings.complex_double import CDF global sage.rings.complex_double = undefined global CDF = undefined 27 from sage.rings.real_double import RDF, RealDoubleElement 28 from sage.rings.integer_ring import ZZ 29 from sage.rings.integer import Integer 30 from sage.misc.superseded import deprecation 31 32 ############################################################################## 33 # There are many functions on elements of a ring, which mathematicians 34 # usually write f(x), e.g., it is weird to write x.log() and natural 35 # to write log(x). The functions below allow for the more familiar syntax. 36 ############################################################################## 37 38 39 def additive_order(x): 40 """ 41 Return the additive order of ``x``. ImportError: dlopen(/var/tmp/sage-9.5-current/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/rings/complex_double.cpython-39-darwin.so, 0x0002): Library not loaded: /usr/local/gfortran/lib/libgfortran.5.dylib Referenced from: /Applications/SageMath-9-5.app/Contents/Frameworks/Sage.framework/Versions/9.5/local/lib/libopenblas_armv8p-r0.3.18.dylib Reason: tried: '/usr/local/gfortran/lib/libgfortran.5.dylib' (no such file), '/usr/lib/libgfortran.5.dylib' (no such file) *************************************************************************** History of session input: *** Last line of input (may not be in above history):