*************************************************************************** IPython post-mortem report {'commit_hash': u'033ab93c7', 'commit_source': 'installation', 'default_encoding': 'UTF-8', 'ipython_path': '/home/hrishabh/sage/local/lib/python2.7/site-packages/IPython', 'ipython_version': '5.8.0', 'os_name': 'posix', 'platform': 'Linux-4.15.0-46-generic-x86_64-with-debian-buster-sid', 'sys_executable': '/home/hrishabh/sage/local/bin/python2', 'sys_platform': 'linux2', 'sys_version': '2.7.15 (default, Mar 10 2019, 20:33:22) \n[GCC 7.3.0]'} *************************************************************************** *************************************************************************** Crash traceback: --------------------------------------------------------------------------- --------------------------------------------------------------------------- ImportError Python 2.7.15: /home/hrishabh/sage/local/bin/python2 Thu Mar 21 20:28:50 2019 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. /home/hrishabh/sage/src/bin/sage-ipython in () 1 #!/usr/bin/env sage-python23 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() in initialize(self=, argv=None) /home/hrishabh/sage/local/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 /home/hrishabh/sage/local/lib/python2.7/site-packages/IPython/terminal/ipapp.pyc in initialize(self=, argv=None) 301 302 return super(TerminalIPythonApp, self).parse_command_line(argv) 303 304 @catch_config_error 305 def initialize(self, argv=None): 306 """Do actions after construct, but before starting the app.""" 307 super(TerminalIPythonApp, self).initialize(argv) 308 if self.subapp is not None: 309 # don't bother initializing further, starting subapp 310 return 311 # print self.extra_args 312 if self.extra_args and not self.something_to_run: 313 self.file_to_run = self.extra_args[0] 314 self.init_path() 315 # create the shell --> 316 self.init_shell() self.init_shell = > 317 # and draw the banner 318 self.init_banner() 319 # Now a variety of things that happen after the banner is printed. 320 self.init_gui_pylab() 321 self.init_extensions() 322 self.init_code() 323 324 def init_shell(self): 325 """initialize the InteractiveShell instance""" 326 # Create an InteractiveShell instance. 327 # shell.display_banner should always be False for the terminal 328 # based app, because we call shell.show_banner() by hand below 329 # so the banner shows *before* all extension loading stuff. 330 self.shell = self.interactive_shell_class.instance(parent=self, 331 profile_dir=self.profile_dir, /home/hrishabh/sage/local/lib/python2.7/site-packages/sage/repl/interpreter.pyc in init_shell(self=) 743 self.shell.has_sage_extensions = SAGE_EXTENSION in self.extensions 744 745 # Load the %lprun extension if available 746 try: 747 import line_profiler 748 except ImportError: 749 pass 750 else: 751 self.extensions.append('line_profiler') 752 753 if self.shell.has_sage_extensions: 754 self.extensions.remove(SAGE_EXTENSION) 755 756 # load sage extension here to get a crash if 757 # something is wrong with the sage library --> 758 self.shell.extension_manager.load_extension(SAGE_EXTENSION) self.shell.extension_manager.load_extension = > global SAGE_EXTENSION = 'sage' 759 760 /home/hrishabh/sage/local/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: /home/hrishabh/sage/local/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. /home/hrishabh/sage/local/lib/python2.7/site-packages/sage/__init__.pyc in load_ipython_extension(*args=(,)) 1 __all__ = ['all'] 2 3 # Set sage.__version__ to the current version number. This is analogous 4 # to many other Python packages. 5 from sage.version import version as __version__ 6 7 # Make sure that the correct zlib library is loaded. This is needed 8 # to prevent the system zlib to be loaded instead of the Sage one. 9 # See https://trac.sagemath.org/ticket/23122 10 import zlib 11 12 # IPython calls this when starting up 13 def load_ipython_extension(*args): 14 import sage.repl.ipython_extension ---> 15 sage.repl.ipython_extension.load_ipython_extension(*args) sage.repl.ipython_extension.load_ipython_extension = args = (,) 16 17 18 # Monkey-patch inspect.isfunction() to support Cython functions. 19 def isfunction(obj): 20 """ 21 Check whether something is a function. 22 23 We assume that anything which has a genuine ``__code__`` 24 attribute (not using ``__getattr__`` overrides) is a function. 25 This is meant to support Cython functions. 26 27 EXAMPLES:: 28 29 sage: from inspect import isfunction 30 sage: def f(): pass 31 sage: isfunction(f) /home/hrishabh/sage/local/lib/python2.7/site-packages/sage/repl/ipython_extension.pyc in wrapper(*args=(,), **kwargs={}) 547 ....: if work: 548 ....: return 'foo worked' 549 ....: raise RuntimeError("foo didn't work") 550 sage: foo(False) 551 Traceback (most recent call last): 552 ... 553 RuntimeError: foo didn't work 554 sage: foo(True) 555 'foo worked' 556 sage: foo(False) 557 sage: foo(True) 558 """ 559 @wraps(func) 560 def wrapper(*args, **kwargs): 561 if not wrapper.has_run: --> 562 result = func(*args, **kwargs) result = undefined global func = undefined args = (,) kwargs = {} 563 wrapper.has_run = True 564 return result 565 wrapper.has_run = False 566 return wrapper 567 568 569 @run_once 570 def load_ipython_extension(ip): 571 """ 572 Load the extension in IPython. 573 """ 574 # this modifies ip 575 SageCustomizations(shell=ip) /home/hrishabh/sage/local/lib/python2.7/site-packages/sage/repl/ipython_extension.pyc in load_ipython_extension(ip=) 560 def wrapper(*args, **kwargs): 561 if not wrapper.has_run: 562 result = func(*args, **kwargs) 563 wrapper.has_run = True 564 return result 565 wrapper.has_run = False 566 return wrapper 567 568 569 @run_once 570 def load_ipython_extension(ip): 571 """ 572 Load the extension in IPython. 573 """ 574 # this modifies ip --> 575 SageCustomizations(shell=ip) global SageCustomizations = global shell = undefined ip = /home/hrishabh/sage/local/lib/python2.7/site-packages/sage/repl/ipython_extension.pyc in __init__(self=, shell=) 418 def __init__(self, shell=None): 419 """ 420 Initialize the Sage plugin. 421 """ 422 self.shell = shell 423 424 self.auto_magics = SageMagics(shell) 425 self.shell.register_magics(self.auto_magics) 426 427 import sage.misc.edit_module as edit_module 428 self.shell.set_hook('editor', edit_module.edit_devel) 429 430 self.init_inspector() 431 self.init_line_transforms() 432 --> 433 import sage.all # until sage's import hell is fixed sage.all = undefined 434 435 self.shell.verbose_quit = True 436 self.set_quit_hook() 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) /home/hrishabh/sage/local/lib/python2.7/site-packages/sage/all.py in () 87 from sage.misc.sh import sh 88 89 from sage.libs.all import * 90 from sage.data_structures.all import * 91 from sage.doctest.all import * 92 93 from sage.structure.all import * 94 from sage.rings.all import * 95 from sage.arith.all import * 96 from sage.matrix.all import * 97 98 from sage.symbolic.all import * 99 from sage.modules.all import * 100 from sage.monoids.all import * 101 from sage.algebras.all import * --> 102 from sage.modular.all import * global sage.modular.all = undefined 103 from sage.sat.all import * 104 from sage.schemes.all import * 105 from sage.graphs.all import * 106 from sage.groups.all import * 107 from sage.arith.power import generic_power as power 108 from sage.databases.all import * 109 from sage.categories.all import * 110 from sage.sets.all import * 111 from sage.probability.all import * 112 from sage.interfaces.all import * 113 114 from sage.functions.all import * 115 from sage.calculus.all import * 116 117 lazy_import('sage.tests', 'all', as_='tests', deprecation=27337) /home/hrishabh/sage/local/lib/python2.7/site-packages/sage/modular/all.py in () 39 40 lazy_import("sage.modular.buzzard", 'buzzard_tpslopes', deprecation=27066) 41 42 from .etaproducts import (EtaGroup, EtaProduct, EtaGroupElement, 43 AllCusps, CuspFamily) 44 lazy_import("sage.modular.etaproducts", ['num_cusps_of_width', 'qexp_eta', 45 'eta_poly_relations'], 46 deprecation=26196) 47 48 from .overconvergent.all import * 49 50 from .local_comp.all import * 51 52 from .cusps_nf import NFCusp, NFCusps, Gamma0_NFCusps 53 ---> 54 from .btquotients.all import * global btquotients.all = undefined 55 56 from .pollack_stevens.all import * 57 58 del absolute_import /home/hrishabh/sage/local/lib/python2.7/site-packages/sage/modular/btquotients/all.py in () 1 from __future__ import absolute_import ----> 2 from .btquotient import BruhatTitsQuotient global btquotient = undefined global BruhatTitsQuotient = undefined 3 #from pautomorphicform import pAdicAutomorphicForms 4 #from pautomorphicform import BruhatTitsHarmonicCocycles /home/hrishabh/sage/local/lib/python2.7/site-packages/sage/modular/btquotients/btquotient.py in () 43 from sage.matrix.constructor import Matrix 44 from sage.matrix.matrix_space import MatrixSpace 45 from sage.structure.sage_object import SageObject 46 from sage.rings.all import ZZ, Zmod, QQ 47 from sage.misc.latex import latex 48 from sage.rings.padics.precision_error import PrecisionError 49 import collections 50 from sage.misc.misc_c import prod 51 from sage.structure.unique_representation import UniqueRepresentation 52 from sage.misc.cachefunc import cached_method 53 from sage.arith.all import gcd, xgcd, kronecker_symbol, fundamental_discriminant 54 from sage.rings.padics.all import Qp, Zp 55 from sage.rings.finite_rings.finite_field_constructor import GF 56 from sage.algebras.quatalg.all import QuaternionAlgebra 57 from sage.quadratic_forms.all import QuadraticForm ---> 58 from sage.graphs.all import Graph global sage.graphs.all = undefined global Graph = undefined 59 from sage.libs.all import pari 60 from sage.interfaces.all import magma 61 from copy import copy 62 from sage.plot.colors import rainbow 63 from sage.rings.number_field.all import NumberField 64 from sage.modular.arithgroup.all import Gamma0 65 from sage.misc.lazy_attribute import lazy_attribute 66 from sage.modular.dirichlet import DirichletGroup 67 from sage.modular.arithgroup.congroup_gammaH import GammaH_constructor 68 from sage.misc.misc import verbose 69 70 71 class DoubleCosetReduction(SageObject): 72 r""" 73 Edges in the Bruhat-Tits tree are represented by cosets of /home/hrishabh/sage/local/lib/python2.7/site-packages/sage/graphs/all.py in () 1 from __future__ import absolute_import 2 3 from sage.misc.lazy_import import lazy_import 4 5 lazy_import("sage.graphs.graph_generators", "graphs") 6 lazy_import("sage.graphs.digraph_generators", "digraphs") 7 lazy_import("sage.graphs.hypergraph_generators", "hypergraphs") ----> 8 from .graph_database import GraphDatabase, GenericGraphQuery, GraphQuery global graph_database = undefined global GraphDatabase = undefined global GenericGraphQuery = undefined global GraphQuery = undefined 9 from .graph import Graph 10 from .digraph import DiGraph 11 from .bipartite_graph import BipartiteGraph 12 import sage.graphs.weakly_chordal 13 import sage.graphs.lovasz_theta 14 import sage.graphs.partial_cube 15 from . import graph_list as graphs_list 16 lazy_import("sage.graphs", "graph_coloring") 17 lazy_import("sage.graphs.cliquer", ['all_max_clique', 'max_clique', 18 'clique_number'], 19 deprecation=26200) 20 from .graph_database import graph_db_info 21 lazy_import("sage.graphs.graph_editor", "graph_editor") 22 23 from sage.graphs.isgci import graph_classes 24 25 """ 26 TESTS: 27 28 Test that sagenb.misc.support is not imported (see :trac:`22941`):: 29 30 sage: import sage.graphs.graph_editor 31 sage: 'sagenb.misc.support' in sys.modules /home/hrishabh/sage/local/lib/python2.7/site-packages/sage/graphs/graph_database.py in () 33 REFERENCES: 34 35 - Data provided by Jason Grout (Brigham Young University). [Online] 36 Available: http://artsci.drake.edu/grout/graphs/ 37 """ 38 39 ################################################################################ 40 # Copyright (C) 2007 Emily A. Kirkman 41 # 42 # 43 # Distributed under the terms of the GNU General Public License (GPL) 44 # http://www.gnu.org/licenses/ 45 ################################################################################ 46 from __future__ import print_function, absolute_import 47 ---> 48 from . import graph global graph = undefined 49 import os 50 import re 51 from sage.rings.integer import Integer 52 from sage.databases.sql_db import SQLDatabase, SQLQuery 53 from sage.env import GRAPHS_DATA_DIR 54 from sage.graphs.graph import Graph 55 dblocation = os.path.join(GRAPHS_DATA_DIR,'graphs.db') 56 57 58 def degseq_to_data(degree_sequence): 59 """ 60 Convert a degree sequence list to a sorted (max-min) integer data type. 61 62 The input degree sequence list (of Integers) is converted to a sorted 63 (max-min) integer data type, as used for faster access in the underlying /home/hrishabh/sage/local/lib/python2.7/site-packages/sage/graphs/graph.py in () 406 import six 407 from six.moves import range 408 409 from copy import copy 410 from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing 411 from sage.misc.superseded import deprecation 412 from sage.rings.integer import Integer 413 from sage.rings.integer_ring import ZZ 414 import sage.graphs.generic_graph_pyx as generic_graph_pyx 415 from sage.graphs.generic_graph import GenericGraph 416 from sage.graphs.digraph import DiGraph 417 from sage.graphs.independent_sets import IndependentSets 418 from sage.misc.rest_index_of_methods import doc_index, gen_thematic_rest_table_index 419 420 --> 421 class Graph(GenericGraph): global Graph = undefined global GenericGraph = None 422 r""" 423 Undirected graph. 424 425 A graph is a set of vertices connected by edges. See the 426 :wikipedia:`Graph_(mathematics)` for more information. For a collection of 427 pre-defined graphs, see the :mod:`~sage.graphs.graph_generators` module. 428 429 A :class:`Graph` object has many methods whose list can be obtained by 430 typing ``g.`` (i.e. hit the 'tab' key) or by reading the documentation 431 of :mod:`~sage.graphs.graph`, :mod:`~sage.graphs.generic_graph`, and 432 :mod:`~sage.graphs.digraph`. 433 434 INPUT: 435 436 By default, a :class:`Graph` object is simple (i.e. no *loops* nor *multiple /home/hrishabh/sage/local/lib/python2.7/site-packages/sage/graphs/graph.py in Graph() 8179 p.solve(log=verbose) 8180 return True 8181 except MIPSolverException: 8182 return False 8183 else: 8184 raise ValueError('algorithm must be set to "Edmonds", "LP_matching" or "LP"') 8185 8186 # Aliases to functions defined in other modules 8187 from sage.graphs.weakly_chordal import is_long_hole_free, is_long_antihole_free, is_weakly_chordal 8188 from sage.graphs.asteroidal_triples import is_asteroidal_triple_free 8189 from sage.graphs.chrompoly import chromatic_polynomial 8190 from sage.graphs.graph_decompositions.rankwidth import rank_decomposition 8191 from sage.graphs.graph_decompositions.vertex_separation import pathwidth 8192 from sage.graphs.matchpoly import matching_polynomial 8193 from sage.graphs.cliquer import all_max_clique as cliques_maximum -> 8194 from sage.graphs.spanning_tree import random_spanning_tree global sage.graphs.spanning_tree = undefined global random_spanning_tree = undefined 8195 from sage.graphs.graph_decompositions.graph_products import is_cartesian_product 8196 from sage.graphs.distances_all_pairs import is_distance_regular 8197 from sage.graphs.base.static_dense_graph import is_strongly_regular 8198 from sage.graphs.line_graph import is_line_graph 8199 from sage.graphs.tutte_polynomial import tutte_polynomial 8200 from sage.graphs.lovasz_theta import lovasz_theta 8201 from sage.graphs.partial_cube import is_partial_cube 8202 from sage.graphs.orientations import strong_orientations_iterator, random_orientation 8203 from sage.graphs.connectivity import bridges, cleave, spqr_tree 8204 8205 8206 _additional_categories = { 8207 "is_long_hole_free" : "Graph properties", 8208 "is_long_antihole_free" : "Graph properties", 8209 "is_weakly_chordal" : "Graph properties", /home/hrishabh/sage/local/lib/python2.7/site-packages/sage/graphs/spanning_tree.pyx in init sage.graphs.spanning_tree (build/cythonized/sage/graphs/spanning_tree.c:13928)() 53 # Copyright (c) 2009 Mike Hansen 54 # Copyright (c) 2010 Gregory McWhirter 55 # Copyright (c) 2010 Minh Van Nguyen 56 # 57 # This program is free software: you can redistribute it and/or modify 58 # it under the terms of the GNU General Public License as published by 59 # the Free Software Foundation, either version 2 of the License, or 60 # (at your option) any later version. 61 # https://www.gnu.org/licenses/ 62 # **************************************************************************** 63 from __future__ import absolute_import 64 65 cimport cython 66 67 from sage.sets.disjoint_set cimport DisjointSet_of_hashables ---> 68 from sage.graphs.graph import Graph global sage.graphs.graph = undefined global Graph = undefined 69 cpdef kruskal(G, wfunction=None, bint check=False): 70 r""" 71 Minimum spanning tree using Kruskal's algorithm. 72 73 This function assumes that we can only compute minimum spanning trees for 74 undirected graphs. Such graphs can be weighted or unweighted, and they can 75 have multiple edges (since we are computing the minimum spanning tree, only 76 the minimum weight among all `(u,v)`-edges is considered, for each pair 77 of vertices `u`, `v`). 78 79 INPUT: 80 81 - ``G`` -- an undirected graph. 82 83 - ``weight_function`` (function) - a function that inputs an edge ``e`` ImportError: cannot import name Graph *************************************************************************** History of session input: *** Last line of input (may not be in above history):