On Nov 25, 2007 10:30 AM, William Stein <[EMAIL PROTECTED]> wrote: > > On Nov 25, 2007 10:29 AM, Timothy Clemans <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I started writing an external library that uses Sage and I meditatly ran > > into: > > > > >>> import sage.rings.integer > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > ImportError: libcsage.so: cannot open shared object file: No such file > > or directory > > >>> import sage.rings.arith > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > File > > "/home/timothy/sage-2.8.13/local/lib/python2.5/site-packages/sage/rings/arith.py", > > line 14, in <module> > > import sage.misc.misc as misc > > File > > "/home/timothy/sage-2.8.13/local/lib/python2.5/site-packages/sage/misc/misc.py", > > line 28, in <module> > > SAGE_ROOT = os.environ["SAGE_ROOT"] > > File "/home/timothy/sage-2.8.13/local/lib/python2.5/UserDict.py", > > line 22, in __getitem__ > > raise KeyError(key) > > KeyError: 'SAGE_ROOT'
You can't use anything from the Sage library if the environment isn't setup. If you use "sage -python" or "sage -ipython", then it will start Sage's Python or IPython with the environment setup correctly. William > > > > I'm using Ubuntu 7.10 64 on AMD 64X2. I'm using Sage 2.8.13 built from > > source upgraded to 2.8.14. I tried the Ubuntu 32 Sage binary before > > building from source. > > > > When I use Sage to run: > > > > [simport.py] ------ > > from sage.rings.integer import Integer > > > > I get > > > > ------------------------------------------------------------ > > Unhandled SIGSEGV: A segmentation fault occured in SAGE. > > This probably occured because a *compiled* component > > of SAGE has a bug in it (typically accessing invalid memory) > > or is not properly wrapped with _sig_on, _sig_off. > > You might want to run SAGE under gdb with 'sage -gdb' to debug this. > > SAGE will now terminate (sorry). > > ------------------------------------------------------------ > > > > sage: Error running simport.py using Python > > > > In my library I won't want to have to import all of Sage just to be > > able to use Integer, factor, etc. > > > > You *have* to do > > import sage.all > > before doing any other imports of mathematical things from the sage library. > Full stop. It should not and cannot work otherwise. > > -- William > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/ -~----------~----~----~----~------~----~------~--~---