I am implementing unordered rooted trees in Sage (to use them in B-series). 
When trying to iinherit from 
sage.combinat.abstract_tree.AbstractClonableTree I get an ImportError.

I have successfully called OrderedTrees() from the notebook, so my Sage 
installation is sound. The problem occurs when I use Eclipse.

I launch Eclipse from the Sage shell, and use the Python interpreter 
provided by Sage (/usr/lib/sagemath/local/bin/python2.7). I keep my .py 
files in a directory in my SAGE_PATH. I have successfully imported and 
inherited from classes in Sage (ClonableElement). This code runs, both in 
Eclipse and the nootebook.

However, the following line, even when it is the only line in a file, 
elicit the following error (as does all attempts to import anything 
depending on "abstrac_tree"):

import sage.combinat.abstract_tree

Traceback (most recent call last):
  File 
"/home/henrik/Documents/studier/masteroppgave/code/pybs/pybs/scratch2.py", 
line 5, in <module>
    import sage.combinat.abstract_tree# import AbstractClonableTree
  File 
"/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/combinat/abstract_tree.py",
 
line 67, in <module>
    from sage.rings.integer import Integer
  File "sage/rings/rational.pxd", line 10, in init sage.rings.integer 
(build/cythonized/sage/rings/integer.c:41630)
  File "sage/rings/rational.pyx", line 56, in init sage.rings.rational 
(build/cythonized/sage/rings/rational.c:30843)
  File 
"/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/rational_field.py",
 
line 55, in <module>
    import infinity
  File 
"/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/infinity.py", 
line 213, in <module>
    from sage.rings.integer_ring import ZZ
  File "sage/rings/integer_ring.pyx", line 67, in init 
sage.rings.integer_ring (build/cythonized/sage/rings/integer_ring.c:11566)
  File 
"/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/structure/factorization.py",
 
line 188, in <module>
    from sage.misc.all import prod
  File 
"/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/misc/all.py", 
line 89, in <module>
    from functional import (additive_order,
  File 
"/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/misc/functional.py", 
line 36, in <module>
    from sage.rings.complex_double import CDF
  File "sage/rings/real_double.pxd", line 8, in init 
sage.rings.complex_double 
(build/cythonized/sage/rings/complex_double.c:20095)
  File "sage/rings/real_double.pyx", line 56, in init 
sage.rings.real_double (build/cythonized/sage/rings/real_double.c:22825)
ImportError: cannot import name ZZ

Since recursive trees work from the notebook, I guess the problem is me 
doing something wrong trying to import it, but I can't think of what it 
is...

Regards,
Henrik S. Sundklakk

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to