Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Import problem

Hi all:

I'm editing sage.categories.quotient_fields and trying to import the algebraic_dependence() function. When i do so by inserting

from sage.rings.polynomial.multi_polynomial_sequence import algebraic_dependence

at the top of the file, saving, and rebuilding Sage, i get the following error when starting Sage. Is it some kind of circular importing problem?

AttributeError                            Traceback (most recent call last)

/Applications/sage/local/lib/python2.6/site-packages/IPython/ipmaker.pyc in     force_import(modname, force_reload)
 61         reload(sys.modules[modname])
 62     else:
---> 63         __import__(modname)
 64         
 65 

/Applications/sage/local/bin/ipy_profile_sage.py in <module>()
  5     preparser(True)
  6     
----> 7     import sage.all_cmdline
  8     sage.all_cmdline._init_cmdline(globals())
  9     

/Applications/sage/local/lib/python2.6/site-packages/sage/all_cmdline.py in <module>()
 12 try:
 13 
---> 14     from sage.all import *
 15     from sage.calculus.predefined import x
 16     preparser(on=True)

/Applications/sage/local/lib/python2.6/site-packages/sage/all.py in <module>()
 66 from time                import sleep
 67 
---> 68 from sage.misc.all       import *         # takes a while
 69 
 70 from sage.misc.sh import sh

/Applications/sage/local/lib/python2.6/site-packages/sage/misc/all.py in <module>()
 79 from func_persist import func_persist
 80 
---> 81 from functional import (additive_order,
 82                         sqrt as numerical_sqrt,
 83                         arg,

/Applications/sage/local/lib/python2.6/site-packages/sage/misc/functional.py in <module>()
 34 
 35 
---> 36 from sage.rings.complex_double import CDF
 37 from sage.rings.real_double import RDF, RealDoubleElement
 38 

/Applications/sage/local/bin/integer.pxd in init sage.rings.complex_double (sage/rings/complex_double.c:15016)()
  7 
  8 
----> 9 
 10 
 11 

/Applications/sage/local/bin/integer.pyx in init sage.rings.integer (sage/rings/integer.c:35507)()
169 
170 
--> 171 
172 
173 

/Applications/sage/local/lib/python2.6/site-packages/sage/rings/infinity.py in <module>()
198 #import sage.rings.real_mpfr
199 import sage.rings.integer
--> 200 import sage.rings.rational
201 
202 from sage.rings.integer_ring import ZZ

/Applications/sage/local/bin/fast_arith.pxd in init sage.rings.rational (sage/rings/rational.c:25818)()
  1 
  2 
----> 3 
  4 
  5 

/Applications/sage/local/bin/fast_arith.pyx in init sage.rings.fast_arith (sage/rings/fast_arith.c:7675)()
 49 
 50 
---> 51 
 52 
 53 

/Applications/sage/local/bin/integer_ring.pyx in init sage.rings.integer_ring (sage/rings/integer_ring.c:11235)()
 65 
 66 
---> 67 
 68 
 69 

/Applications/sage/local/lib/python2.6/site-packages/sage/rings/rational_field.py in <module>()
914         
915 
--> 916 QQ = RationalField()
917 Q = QQ
918 

/Applications/sage/local/lib/python2.6/site-packages/sage/rings/rational_field.py in __init__(self)
210             ('x',)
211         """
--> 212         from sage.categories.basic import QuotientFields
213         ParentWithGens.__init__(self, self, category = QuotientFields())
214         self._assign_names(('x',),normalize=False) # ???

/Applications/sage/local/lib/python2.6/site-packages/sage/categories/basic.py in <module>()
 46 
 47 from fields import Fields
---> 48 from quotient_fields import QuotientFields
 49 from finite_fields import FiniteFields
 50 

/Applications/sage/local/lib/python2.6/site-packages/sage/categories/quotient_fields.py in <module>()
 13 from sage.misc.abstract_method import abstract_method
 14 from sage.misc.misc_c import prod
---> 15 from sage.rings.polynomial.multi_polynomial_sequence import algebraic_dependence
 16 
 17 class QuotientFields(Category):

/Applications/sage/local/lib/python2.6/site-packages/sage/rings/polynomial/multi_polynomial_sequence.py in <module>()
154 
155 
--> 156 from sage.rings.polynomial.multi_polynomial_ring import is_MPolynomialRing
157 from sage.rings.quotient_ring import is_QuotientRing
158 from sage.rings.quotient_ring_element import QuotientRingElement

/Applications/sage/local/lib/python2.6/site-packages/sage/rings/polynomial/multi_polynomial_ring.py in <module>()
 68 
 69 import sage.rings.integral_domain as integral_domain
---> 70 import sage.rings.fraction_field_element as fraction_field_element
 71 
 72 from sage.rings.integer_ring import is_IntegerRing

/Applications/sage/local/bin/fraction_field_element.pyx in init sage.rings.fraction_field_element (sage/rings/fraction_field_element.c:9193)()
 42 
 43 
---> 44 
 45 
 46 

AttributeError: 'module' object has no attribute 'ZZ'
Error importing ipy_profile_sage - perhaps you should run %upgrade?
WARNING: Loading of ipy_profile_sage failed.