*************************************************************************** IPython post-mortem report {'commit_hash': 'fd4cac190', 'commit_source': 'installation', 'default_encoding': 'utf-8', 'ipython_path': '/Users/rparini/opt/miniconda3/envs/sagetest/lib/python3.9/site-packages/IPython', 'ipython_version': '7.33.0', 'os_name': 'posix', 'platform': 'macOS-12.4-arm64-arm-64bit', 'sys_executable': '/Users/rparini/opt/miniconda3/envs/sagetest/bin/python', 'sys_platform': 'darwin', 'sys_version': '3.9.13 | packaged by conda-forge | (main, May 27 2022, ' '17:00:33) \n' '[Clang 13.0.1 ]'} *************************************************************************** *************************************************************************** Crash traceback: --------------------------------------------------------------------------- --------------------------------------------------------------------------- ImportErrorPython 3.9.13: /Users/rparini/opt/miniconda3/envs/sagetest/bin/python Sun Aug 21 23:32:03 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. ~/opt/miniconda3/envs/sagetest/bin/sage-ipython in 1 #!/Users/rparini/opt/miniconda3/envs/sagetest/bin/python 2 # -*- coding: utf-8 -*- 3 """ 4 Sage IPython startup script. 5 """ 6 7 # Display startup banner. Do this before anything else to give the user 8 # early feedback that Sage is starting. 9 from sage.misc.banner import banner 10 banner() 11 12 from sage.repl.interpreter import SageTerminalApp 13 14 app = SageTerminalApp.instance() ---> 15 app.initialize() global app.initialize = > 16 app.start() ~/opt/miniconda3/envs/sagetest/lib/python3.9/site-packages/traitlets/config/application.py in inner(app=, *args=(), **kwargs={}) 95 IS_PYTHONW = sys.executable and sys.executable.endswith("pythonw.exe") 96 97 98 def catch_config_error(method): 99 """Method decorator for catching invalid config (Trait/ArgumentErrors) during init. 100 101 On a TraitError (generally caused by bad config), this will print the trait's 102 message, and exit the app. 103 104 For use on init methods, to prevent invoking excepthook on invalid input. 105 """ 106 107 @functools.wraps(method) 108 def inner(app, *args, **kwargs): 109 try: --> 110 return method(app, *args, **kwargs) global method = undefined app = args = () kwargs = {} 111 except (TraitError, ArgumentError) as e: 112 app.log.fatal("Bad config encountered during initialization: %s", e) 113 app.log.debug("Config at the time: %s", app.config) 114 app.exit(1) 115 116 return inner 117 118 119 class ApplicationError(Exception): 120 pass 121 122 123 class LevelFormatter(logging.Formatter): 124 """Formatter with additional `highlevel` record 125 ~/opt/miniconda3/envs/sagetest/lib/python3.9/site-packages/IPython/terminal/ipapp.py in initialize(self=, argv=None) 304 305 return super(TerminalIPythonApp, self).parse_command_line(argv) 306 307 @catch_config_error 308 def initialize(self, argv=None): 309 """Do actions after construct, but before starting the app.""" 310 super(TerminalIPythonApp, self).initialize(argv) 311 if self.subapp is not None: 312 # don't bother initializing further, starting subapp 313 return 314 # print self.extra_args 315 if self.extra_args and not self.something_to_run: 316 self.file_to_run = self.extra_args[0] 317 self.init_path() 318 # create the shell --> 319 self.init_shell() self.init_shell = > 320 # and draw the banner 321 self.init_banner() 322 # Now a variety of things that happen after the banner is printed. 323 self.init_gui_pylab() 324 self.init_extensions() 325 self.init_code() 326 327 def init_shell(self): 328 """initialize the InteractiveShell instance""" 329 # Create an InteractiveShell instance. 330 # shell.display_banner should always be False for the terminal 331 # based app, because we call shell.show_banner() by hand below 332 # so the banner shows *before* all extension loading stuff. 333 self.shell = self.interactive_shell_class.instance(parent=self, 334 profile_dir=self.profile_dir, ~/opt/miniconda3/envs/sagetest/lib/python3.9/site-packages/sage/repl/interpreter.py in init_shell(self=) 772 773 # Load the %lprun extension if available 774 try: 775 import line_profiler 776 assert line_profiler # silence pyflakes 777 except ImportError: 778 pass 779 else: 780 self.extensions.append('line_profiler') 781 782 if self.shell.has_sage_extensions: 783 self.extensions.remove(SAGE_EXTENSION) 784 785 # load sage extension here to get a crash if 786 # something is wrong with the sage library --> 787 self.shell.extension_manager.load_extension(SAGE_EXTENSION) self.shell.extension_manager.load_extension = > global SAGE_EXTENSION = 'sage' ~/opt/miniconda3/envs/sagetest/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: ~/opt/miniconda3/envs/sagetest/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' ~/opt/miniconda3/envs/sagetest/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 ~/opt/miniconda3/envs/sagetest/lib/python3.9/site-packages/sage/repl/ipython_extension.py in wrapper(*args=(,), **kwargs={}) 591 ....: if work: 592 ....: return 'foo worked' 593 ....: raise RuntimeError("foo didn't work") 594 sage: foo(False) 595 Traceback (most recent call last): 596 ... 597 RuntimeError: foo didn't work 598 sage: foo(True) 599 'foo worked' 600 sage: foo(False) 601 sage: foo(True) 602 """ 603 @wraps(func) 604 def wrapper(*args, **kwargs): 605 if not wrapper.has_run: --> 606 result = func(*args, **kwargs) result = undefined global func = undefined args = (,) kwargs = {} 607 wrapper.has_run = True 608 return result 609 wrapper.has_run = False 610 return wrapper 611 612 613 @run_once 614 def load_ipython_extension(ip): 615 """ 616 Load the extension in IPython. 617 """ 618 # this modifies ip 619 SageCustomizations(shell=ip) ~/opt/miniconda3/envs/sagetest/lib/python3.9/site-packages/sage/repl/ipython_extension.py in load_ipython_extension(ip=) 604 def wrapper(*args, **kwargs): 605 if not wrapper.has_run: 606 result = func(*args, **kwargs) 607 wrapper.has_run = True 608 return result 609 wrapper.has_run = False 610 return wrapper 611 612 613 @run_once 614 def load_ipython_extension(ip): 615 """ 616 Load the extension in IPython. 617 """ 618 # this modifies ip --> 619 SageCustomizations(shell=ip) global SageCustomizations = global shell = undefined ip = ~/opt/miniconda3/envs/sagetest/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 438 self.register_interface_magics() 439 440 if SAGE_IMPORTALL == 'yes': 441 self.init_environment() 442 443 def register_interface_magics(self): 444 """ 445 Register magics for each of the Sage interfaces 446 """ 447 from sage.repl.interface_magic import InterfaceMagic 448 InterfaceMagic.register_all(self.shell) 449 ~/opt/miniconda3/envs/sagetest/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 * ~/opt/miniconda3/envs/sagetest/lib/python3.9/site-packages/sage/misc/all.py in 61 62 from .mathml import mathml 63 64 from .defaults import (set_default_variable_name, 65 series_precision, set_series_precision) 66 67 from .sage_eval import sage_eval, sageobj 68 69 from .sage_input import sage_input 70 71 lazy_import("sage.misc.cython", "cython_lambda") 72 lazy_import("sage.misc.cython", "cython_compile", "cython") 73 74 from .func_persist import func_persist 75 ---> 76 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 77 base_ring, 78 base_field, 79 basis, 80 category, 81 charpoly, 82 characteristic_polynomial, 83 coerce, 84 cyclotomic_polynomial, 85 decomposition, 86 denominator, 87 det, 88 dimension, 89 dim, 90 discriminant, 91 disc, ~/opt/miniconda3/envs/sagetest/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(/Users/rparini/opt/miniconda3/envs/sagetest/lib/python3.9/site-packages/sage/rings/complex_double.cpython-39-darwin.so, 0x0002): Library not loaded: @rpath/libgsl.25.dylib Referenced from: /Users/rparini/opt/miniconda3/envs/sagetest/lib/python3.9/site-packages/sage/rings/complex_double.cpython-39-darwin.so Reason: tried: '/Users/rparini/opt/miniconda3/envs/sagetest/lib/python3.9/site-packages/sage/rings/../../../../libgsl.25.dylib' (no such file), '/Users/rparini/opt/miniconda3/envs/sagetest/lib/python3.9/site-packages/sage/rings/../../../../libgsl.25.dylib' (no such file), '/Users/rparini/opt/miniconda3/envs/sagetest/bin/../lib/libgsl.25.dylib' (no such file), '/Users/rparini/opt/miniconda3/envs/sagetest/bin/../lib/libgsl.25.dylib' (no such file), '/usr/local/lib/libgsl.25.dylib' (no such file), '/usr/lib/libgsl.25.dylib' (no such file) *************************************************************************** History of session input: *** Last line of input (may not be in above history):