Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

from sage.all import * results in libcsage.so "cannot open shared object file" error

I am having a problem importing sage modules into an instance of python 2.7. I succesfully untared the release binary tarball for 64-bit Ubuntu 10.04 ( http://boxen.math.washington.edu/sage/linux/64bit/sage-4.7.2-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux.tar.lzma ) into ~/sage. I can succesfully run sage with ./sage.

After opening the python console (python), I set the relevant environmental variables and system path:

import sys
import os
os.environ['LD_LIBRARY_PATH'] = '/home/jthetzel/sage/local/lib'
os.environ['SAGE_ROOT'] = '/home/jthetzel/sage'
sys.path.append("/home/jthetzel/sage/local/lib/python/site-packages")

However, the following:

from sage.all import *

Results in:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jthetzel/sage/local/lib/python/site-packages/sage/all.py", line 63, in <module>
    from sage.ext.c_lib import _init_csage, sig_on_count
ImportError: libcsage.so: cannot open shared object file: No such file or directory

The same occurs when I try different system paths, such as /home/jthetzel/sage/local/lib or /home/jthetzel/sage .

Trying locate libcsage.so finds:

/home/jthetzel/sage/devel/sage-main/c_lib/libcsage.so
/home/jthetzel/sage/local/lib/libcsage.so

I have read elsewhere that ./sage -b might fix this error, but it does not in my case.

Could anyone help shed light on why libcsage.so can not be found? I am trying to import the sage modules into my usual python as opposed to Sage's python (./sage -python) because I am eventually trying to access Sage through R's Jython interface, rJython. I appreciate any guidance.