Hi! I can't get sage to work when installing it with conda on a new MacBook Pro with M2 chip and Ventura 13.3.
I tried conda -n sage create sage=9.X python=3.Y for (X,Y) = (5,10), (8,10), (8,11). With Sage 9.5, I get the attached crash report. With Sage 9.8, I get the following linking error below. Cheers, Matthias (sage-py310) matthias@matthiass-air-2 ~ % sage ┌────────────────────────────────────────────────────────────────────┐ │ SageMath version 9.8, Release Date: 2023-02-11 │ │ Using Python 3.10.11. Type "help()" for help. │ └────────────────────────────────────────────────────────────────────┘ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Warning: sage.all is not available; this is a limited REPL. ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ sage: import sage.all --------------------------------------------------------------------------- ImportError Traceback (most recent call last) Cell In[1], line 1 ----> 1 import sage.all File ~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/all.py:168 166 from sage.modules.all import * 167 from sage.monoids.all import * --> 168 from sage.algebras.all import * 169 from sage.modular.all import * 170 from sage.sat.all import * File ~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/algebras/all.py:21 5 #***************************************************************************** 6 # Copyright (C) 2005 William Stein <wst...@gmail.com> 7 # (...) 17 # http://www.gnu.org/licenses/ 18 #***************************************************************************** 19 from sage.misc.lazy_import import lazy_import ---> 21 import sage.algebras.catalog as algebras 23 from .quatalg.all import * 24 from .steenrod.all import * File ~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/algebras/catalog.py:84 1 r""" 2 Catalog of Algebras 3 (...) 80 <sage.algebras.yokonuma_hecke_algebra.YokonumaHeckeAlgebra>` 81 """ 83 from sage.algebras.free_algebra import FreeAlgebra as Free ---> 84 from sage.algebras.quatalg.quaternion_algebra import QuaternionAlgebra as Quaternion 85 from sage.algebras.steenrod.steenrod_algebra import SteenrodAlgebra as Steenrod 86 from sage.algebras.finite_dimensional_algebras.finite_dimensional_algebra import FiniteDimensionalAlgebra as FiniteDimensional File ~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/algebras/quatalg/quaternion_algebra.py:68 61 from operator import itemgetter 63 from .quaternion_algebra_element import ( 64 QuaternionAlgebraElement_abstract, 65 QuaternionAlgebraElement_generic, 66 QuaternionAlgebraElement_rational_field, 67 QuaternionAlgebraElement_number_field) ---> 68 from . import quaternion_algebra_cython 70 from sage.modular.modsym.p1list import P1List 72 from sage.misc.cachefunc import cached_method File ~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/algebras/quatalg/quaternion_algebra_cython.pyx:1, in init sage.algebras.quatalg.quaternion_algebra_cython (build/cythonized/sage/algebras/quatalg/quaternion_algebra_cython.cpp:6484)() ----> 1 # distutils: language = c++ 2 # distutils: libraries = gmp m NTL_LIBRARIES 3 # distutils: extra_compile_args = NTL_CFLAGS File ~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/matrix/matrix_integer_dense.pyx:1, in init sage.matrix.matrix_integer_dense (build/cythonized/sage/matrix/matrix_integer_dense.cpp:59322)() ----> 1 # -*- coding: utf-8 -*- 2 # distutils: extra_compile_args = NTL_CFLAGS M4RI_CFLAGS 3 # distutils: libraries = iml NTL_LIBRARIES gmp m CBLAS_LIBRARIES ImportError: dlopen(/Users/matthias/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/libs/linbox/ linbox_flint_interface.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '__ZN6FFPACK8CharPolyIN6Givaro8Poly1DomINS1_7ModularIddvEENS1_5DenseEEEEERNT_7ElementERKS7_S9_mNS7_8Domain_t11Element_ptrEmRNSC_8RandIterENS_19FFPACK_CHARPOLY_TAGEm' -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/CALB88e892xzZ_wBXqofXRP0cRQFc75jYt3vVo-hfTFr%3Dbh5Rmw%40mail.gmail.com.
*************************************************************************** IPython post-mortem report {'commit_hash': 'fd4cac190', 'commit_source': 'installation', 'default_encoding': 'utf-8', 'ipython_path': '/Users/matthias/anaconda3/envs/sage/lib/python3.10/site-packages/IPython', 'ipython_version': '7.33.0', 'os_name': 'posix', 'platform': 'macOS-13.3-arm64-arm-64bit', 'sys_executable': '/Users/matthias/anaconda3/envs/sage/bin/python', 'sys_platform': 'darwin', 'sys_version': '3.10.11 | packaged by conda-forge | (main, May 10 2023, ' '19:01:19) [Clang 14.0.6 ]'} *************************************************************************** *************************************************************************** Crash traceback: --------------------------------------------------------------------------- --------------------------------------------------------------------------- ImportError Python 3.10.11: /Users/matthias/anaconda3/envs/sage/bin/python Wed May 24 15:00:52 2023 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. ~/anaconda3/envs/sage/bin/sage-ipython in <module> 1 #!/Users/matthias/anaconda3/envs/sage/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 = <bound method TerminalIPythonApp.initialize of <sage.repl.interpreter.SageTerminalApp object at 0x1026d7f10>> 16 app.start() ~/anaconda3/envs/sage/lib/python3.10/site-packages/traitlets/config/application.py in inner(app=<sage.repl.interpreter.SageTerminalApp object>, *args=(), **kwargs={}) 98 T = TypeVar("T", bound=Callable[..., Any]) 99 100 101 def catch_config_error(method: T) -> T: 102 """Method decorator for catching invalid config (Trait/ArgumentErrors) during init. 103 104 On a TraitError (generally caused by bad config), this will print the trait's 105 message, and exit the app. 106 107 For use on init methods, to prevent invoking excepthook on invalid input. 108 """ 109 110 @functools.wraps(method) 111 def inner(app, *args, **kwargs): 112 try: --> 113 return method(app, *args, **kwargs) global method = undefined app = <sage.repl.interpreter.SageTerminalApp object at 0x1026d7f10> args = () kwargs = {} 114 except (TraitError, ArgumentError) as e: 115 app.log.fatal("Bad config encountered during initialization: %s", e) 116 app.log.debug("Config at the time: %s", app.config) 117 app.exit(1) 118 119 return cast(T, inner) 120 121 122 class ApplicationError(Exception): 123 pass 124 125 126 class LevelFormatter(logging.Formatter): 127 """Formatter with additional `highlevel` record 128 ~/anaconda3/envs/sage/lib/python3.10/site-packages/IPython/terminal/ipapp.py in initialize(self=<sage.repl.interpreter.SageTerminalApp object>, 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 = <bound method SageTerminalApp.init_shell of <sage.repl.interpreter.SageTerminalApp object at 0x1026d7f10>> 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, ~/anaconda3/envs/sage/lib/python3.10/site-packages/sage/repl/interpreter.py in init_shell(self=<sage.repl.interpreter.SageTerminalApp object>) 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 = <bound method ExtensionManager.load_extension of <IPython.core.extensions.ExtensionManager object at 0x1074bb7c0>> global SAGE_EXTENSION = 'sage' ~/anaconda3/envs/sage/lib/python3.10/site-packages/IPython/core/extensions.py in load_extension(self=<IPython.core.extensions.ExtensionManager object>, 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 = <bound method ExtensionManager._call_load_ipython_extension of <IPython.core.extensions.ExtensionManager object at 0x1074bb7c0>> mod = <module 'sage' from '/Users/matthias/anaconda3/envs/sage/lib/python3.10/site-packages/sage/__init__.py'> 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: ~/anaconda3/envs/sage/lib/python3.10/site-packages/IPython/core/extensions.py in _call_load_ipython_extension(self=<IPython.core.extensions.ExtensionManager object>, mod=<module 'sage' from '/Users/matthias/anaconda3/e...e/lib/python3.10/site-packages/sage/__init__.py'>) 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 = <function load_ipython_extension at 0x102944280> self.shell = <sage.repl.interpreter.SageTerminalInteractiveShell object at 0x105873580> 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' ~/anaconda3/envs/sage/lib/python3.10/site-packages/sage/repl/__init__.py in load_ipython_extension(*args=(<sage.repl.interpreter.SageTerminalInteractiveShell object>,)) 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 = <function load_ipython_extension at 0x1077e29e0> args = (<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x105873580>,) 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 ~/anaconda3/envs/sage/lib/python3.10/site-packages/sage/repl/ipython_extension.py in wrapper(*args=(<sage.repl.interpreter.SageTerminalInteractiveShell object>,), **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 = (<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x105873580>,) 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) ~/anaconda3/envs/sage/lib/python3.10/site-packages/sage/repl/ipython_extension.py in load_ipython_extension(ip=<sage.repl.interpreter.SageTerminalInteractiveShell object>) 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 = <class 'sage.repl.ipython_extension.SageCustomizations'> global shell = undefined ip = <sage.repl.interpreter.SageTerminalInteractiveShell object at 0x105873580> ~/anaconda3/envs/sage/lib/python3.10/site-packages/sage/repl/ipython_extension.py in __init__(self=<sage.repl.ipython_extension.SageCustomizations object>, shell=<sage.repl.interpreter.SageTerminalInteractiveShell object>) 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) ~/anaconda3/envs/sage/lib/python3.10/site-packages/sage/all.py in <module> 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 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 * global sage.rings.all = undefined 132 from sage.arith.all import * 133 from sage.matrix.all import * 134 135 from sage.symbolic.all import * 136 from sage.modules.all import * 137 from sage.monoids.all import * 138 from sage.algebras.all import * 139 from sage.modular.all import * 140 from sage.sat.all import * 141 from sage.schemes.all import * 142 from sage.graphs.all import * 143 from sage.groups.all import * 144 from sage.arith.power import generic_power as power 145 from sage.databases.all import * 146 from sage.categories.all import * ~/anaconda3/envs/sage/lib/python3.10/site-packages/sage/rings/all.py in <module> 72 from .real_mpfr import (RealField, RR, 73 create_RealNumber as RealNumber) # this is used by the preparser to wrap real literals -- very important. 74 Reals = RealField 75 76 from .real_double import RealDoubleField, RDF, RealDoubleElement 77 78 from .real_lazy import RealLazyField, RLF, ComplexLazyField, CLF 79 80 from sage.rings.real_arb import RealBallField, RBF 81 82 # Polynomial Rings and Polynomial Quotient Rings 83 from .polynomial.all import * 84 85 86 # Algebraic numbers ---> 87 from .qqbar import (AlgebraicRealField, AA, global qqbar = undefined global AlgebraicRealField = undefined global AA = undefined global AlgebraicReal = undefined global AlgebraicField = undefined global QQbar = undefined global AlgebraicNumber = undefined global number_field_elements_from_algebraics = undefined 88 AlgebraicReal, 89 AlgebraicField, QQbar, 90 AlgebraicNumber, 91 number_field_elements_from_algebraics) 92 from .universal_cyclotomic_field import UniversalCyclotomicField, E 93 94 # Intervals 95 from .real_mpfi import (RealIntervalField, 96 RIF, 97 RealInterval) 98 99 # Complex numbers 100 from .complex_mpfr import ComplexField 101 from .complex_mpfr import create_ComplexNumber as ComplexNumber 102 Complexes = ComplexField ~/anaconda3/envs/sage/lib/python3.10/site-packages/sage/rings/qqbar.py in <module> 2795 2796 if single_number: 2797 nums = nums[0] 2798 2799 if same_field: 2800 hom = fld.hom([exact_generator], codomain=algebraic_field) 2801 2802 return (fld, nums, hom) 2803 2804 2805 # Cache some commonly-used polynomial rings 2806 QQx = QQ['x'] 2807 QQx_x = QQx.gen() 2808 QQy = QQ['y'] 2809 QQy_y = QQy.gen() -> 2810 QQxy = QQ['x', 'y'] global QQxy = undefined global QQ = Rational Field 2811 QQxy_x = QQxy.gen(0) 2812 QQxy_y = QQxy.gen(1) 2813 2814 2815 def cmp_elements_with_same_minpoly(a, b, p): 2816 r""" 2817 Compare the algebraic elements ``a`` and ``b`` knowing that they have the 2818 same minimal polynomial ``p``. 2819 2820 This is an helper function for comparison of algebraic elements (i.e. the 2821 methods :meth:`AlgebraicNumber._richcmp_` and 2822 :meth:`AlgebraicReal._richcmp_`). 2823 2824 INPUT: 2825 ~/anaconda3/envs/sage/lib/python3.10/site-packages/sage/structure/parent.pyx in sage.structure.parent.Parent.__getitem__ (build/cythonized/sage/structure/parent.c:11478)() 1261 sage: class A(Parent): 1262 ....: def __init__(self): 1263 ....: Parent.__init__(self, category=As()) 1264 sage: a = A() 1265 sage: a[1] 1266 'coucou' 1267 """ 1268 try: 1269 meth = super(Parent, self).__getitem__ 1270 except AttributeError: 1271 # needed when self is a Cython object 1272 try: 1273 meth = self.getattr_from_category('__getitem__') 1274 except AttributeError: 1275 return self.list()[n] -> 1276 return meth(n) global meth = undefined global n = undefined 1277 1278 ######################################################################### 1279 # Generators and Homomorphisms 1280 ######################################################################### 1281 1282 def _is_valid_homomorphism_(self, codomain, im_gens, base_map=None): 1283 r""" 1284 Return True if ``im_gens`` defines a valid homomorphism 1285 from self to codomain; otherwise return False. 1286 1287 If determining whether or not a homomorphism is valid has not 1288 been implemented for this ring, then a NotImplementedError exception 1289 is raised. 1290 """ 1291 raise NotImplementedError("Verification of correctness of homomorphisms from %s not yet implemented." % self) ~/anaconda3/envs/sage/lib/python3.10/site-packages/sage/categories/rings.py in __getitem__(self=Rational Field, arg=('x', 'y')) 1162 and elt.imag().is_zero()): 1163 emb = RLF(elt) 1164 else: 1165 emb = CLF(elt) 1166 return self.extension(minpolys[0], names[0], embedding=emb) 1167 try: 1168 # Doing the extension all at once is best, if possible... 1169 return self.extension(minpolys, names) 1170 except (TypeError, ValueError): 1171 # ...but we can also construct it iteratively 1172 return reduce(lambda R, ext: R.extension(*ext), zip(minpolys, names), self) 1173 1174 # 2. Otherwise, try to return a polynomial ring 1175 1176 from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing -> 1177 return PolynomialRing(self, elts) PolynomialRing = <function PolynomialRing at 0x117db0700> self = Rational Field elts = ('x', 'y') 1178 1179 def free_module(self, base=None, basis=None, map=True): 1180 """ 1181 Return a free module `V` over the specified subring together with maps to and from `V`. 1182 1183 The default implementation only supports the case that the base ring is the ring itself. 1184 1185 INPUT: 1186 1187 - ``base`` -- a subring `R` so that this ring is isomorphic 1188 to a finite-rank free `R`-module `V` 1189 1190 - ``basis`` -- (optional) a basis for this ring over the base 1191 1192 - ``map`` -- boolean (default ``True``), whether to return ~/anaconda3/envs/sage/lib/python3.10/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py in PolynomialRing(base_ring=Rational Field, *args=(('x', 'y'),), **kwds={}) 632 names = normalize_names(n, names) 633 634 # At this point, we have only handled the "names" keyword if it was 635 # needed. Since we know the variable names, it would logically be 636 # an error to specify an additional "names" keyword. However, 637 # people often abuse the preparser with 638 # R.<x> = PolynomialRing(QQ, 'x') 639 # and we allow this for historical reasons. However, the names 640 # must be consistent! 641 if "names" in kwds: 642 kwnames = kwds.pop("names") 643 if kwnames != names: 644 raise TypeError("variable names specified twice inconsistently: %r and %r" % (names, kwnames)) 645 646 if multivariate or len(names) != 1: --> 647 return _multi_variate(base_ring, names, **kwds) global _multi_variate = <function _multi_variate at 0x117e62170> base_ring = Rational Field global names = undefined kwds = {} 648 else: 649 return _single_variate(base_ring, names, **kwds) 650 651 652 def unpickle_PolynomialRing(base_ring, arg1=None, arg2=None, sparse=False): 653 """ 654 Custom unpickling function for polynomial rings. 655 656 This has the same positional arguments as the old 657 ``PolynomialRing`` constructor before :trac:`23338`. 658 """ 659 args = [arg for arg in (arg1, arg2) if arg is not None] 660 return PolynomialRing(base_ring, *args, sparse=sparse) 661 662 from sage.misc.persist import register_unpickle_override ~/anaconda3/envs/sage/lib/python3.10/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py in _multi_variate(base_ring=Rational Field, names=('x', 'y'), sparse=True, order=Degree reverse lexicographic term order, implementation=None) 760 from sage.rings.polynomial.term_order import TermOrder 761 n = len(names) 762 order = TermOrder(order, n) 763 764 # "implementation" must be last 765 key = [base_ring, names, n, order, implementation] 766 R = _get_from_cache(key) 767 if R is not None: 768 return R 769 770 # Multiple arguments for the "implementation" keyword which actually 771 # yield the same implementation. We need this for caching. 772 implementation_names = set([implementation]) 773 774 if implementation is None or implementation == "singular": --> 775 from sage.rings.polynomial.multi_polynomial_libsingular import MPolynomialRing_libsingular global sage.rings.polynomial.multi_polynomial_libsingular = undefined MPolynomialRing_libsingular = undefined 776 try: 777 R = MPolynomialRing_libsingular(base_ring, n, names, order) 778 except (TypeError, NotImplementedError): 779 if implementation is not None: 780 raise 781 else: 782 implementation_names.update([None, "singular"]) 783 784 if R is None and implementation is None: 785 # Interpret implementation=None as implementation="generic" 786 implementation = "generic" 787 implementation_names.add(implementation) 788 key[-1] = implementation 789 R = _get_from_cache(key) 790 ~/anaconda3/envs/sage/lib/python3.10/site-packages/sage/rings/polynomial/multi_polynomial_libsingular.pyx in init sage.rings.polynomial.multi_polynomial_libsingular (build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:50118)() ----> 1 r""" 2 Multivariate Polynomials via libSINGULAR 3 4 This module implements specialized and optimized implementations for 5 multivariate polynomials over many coefficient rings, via a shared library 6 interface to SINGULAR. In particular, the following coefficient rings are 7 supported by this implementation: 8 9 - the rational numbers `\QQ`, 10 11 - the ring of integers `\ZZ`, 12 13 - `\ZZ/n\ZZ` for any integer `n`, 14 15 - finite fields `\GF{p^n}` for `p` prime and `n > 0`, 16 17 - and absolute number fields `\QQ(a)`. 18 19 EXAMPLES: 20 21 We show how to construct various multivariate polynomial rings:: 22 23 sage: P.<x,y,z> = QQ[] 24 sage: P 25 Multivariate Polynomial Ring in x, y, z over Rational Field 26 27 sage: f = 27/113 * x^2 + y*z + 1/2; f 28 27/113*x^2 + y*z + 1/2 29 30 sage: P.term_order() 31 Degree reverse lexicographic term order ~/anaconda3/envs/sage/lib/python3.10/site-packages/sage/libs/singular/singular.pyx in init sage.libs.singular.singular (build/cythonized/sage/libs/singular/singular.cpp:15820)() 1543 global _saved_verbose_options 1544 _saved_options = (int(singular_options), 0, 0) 1545 _saved_verbose_options = int(singular_verbose_options) 1546 1547 #On(SW_USE_NTL) 1548 On(SW_USE_EZGCD) 1549 Off(SW_USE_NTL_SORT) 1550 1551 WerrorS_callback = libsingular_error_callback 1552 1553 error_messages = [] 1554 1555 # Save/restore the PATH because libSingular clobbers it: 1556 # https://github.com/Singular/Singular/issues/1119 1557 saved_PATH = os.environ["PATH"] -> 1558 init_libsingular() global init_libsingular = undefined 1559 os.environ["PATH"] = saved_PATH 1560 1561 cdef void libsingular_error_callback(const_char_ptr s): 1562 _s = char_to_str(s) 1563 error_messages.append(_s) 1564 1565 def get_resource(id): 1566 """ 1567 Return a Singular "resource". 1568 1569 INPUT: 1570 1571 - ``id`` -- a single-character string; see 1572 https://github.com/Singular/Singular/blob/spielwiese/resources/feResource.cc 1573 ~/anaconda3/envs/sage/lib/python3.10/site-packages/sage/libs/singular/singular.pyx in sage.libs.singular.singular.init_libsingular (build/cythonized/sage/libs/singular/singular.cpp:13090)() 1517 from sage.env import LIBSINGULAR_PATH 1518 lib = str_to_bytes(LIBSINGULAR_PATH, FS_ENCODING, "surrogateescape") 1519 1520 # This is a workaround for https://github.com/Singular/Singular/issues/1113 1521 # and can be removed once that fix makes it into release of Singular that 1522 # is supported by sage. 1523 from shutil import which 1524 from os.path import dirname 1525 os.environ["SINGULAR_BIN_DIR"] = dirname(which("Singular")) 1526 1527 import platform 1528 if not platform.system().startswith("CYGWIN"): 1529 handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY) 1530 if not handle: 1531 err = dlerror() -> 1532 raise ImportError(f"cannot load Singular library from {LIBSINGULAR_PATH} ({err})") global ImportError = undefined 1533 1534 # load SINGULAR 1535 siInit(lib) 1536 1537 if handle: 1538 dlclose(handle) 1539 1540 # we set and save some global Singular options 1541 singular_options = singular_options | Sy_bit(OPT_REDSB) | Sy_bit(OPT_INTSTRATEGY) | Sy_bit(OPT_REDTAIL) | Sy_bit(OPT_REDTHROUGH) 1542 global _saved_options 1543 global _saved_verbose_options 1544 _saved_options = (int(singular_options), 0, 0) 1545 _saved_verbose_options = int(singular_verbose_options) 1546 1547 #On(SW_USE_NTL) ImportError: cannot load Singular library from (b"dlopen(, 0x0009): tried: '' (no such file), '/System/Volumes/Preboot/Cryptexes/OS' (not a file), '/Users/matthias/anaconda3/envs/sage/lib/python3.10/site-packages/sage/libs/singular/../../../../../' (not a file), '/Users/matthias/anaconda3/envs/sage/bin/../lib/' (not a file), '/usr/lib/' (not a file, not in dyld cache), '' (no such file), '/usr/local/lib/' (not a file), '/usr/lib/' (not a file, not in dyld cache)") *************************************************************************** History of session input: *** Last line of input (may not be in above history):