Sage + Eclipse + PyDev

73 views
Skip to first unread message

Emerson

unread,
Jun 10, 2008, 12:49:22 PM6/10/08
to sage-support
Hello everyone.

I'm trying to set up sage to work with pydev on Eclipse. So far, I've
managed to set the interpreter properly (it does seem to work
properly). The problem is that when I try to do this...

from sage.all import *

...I get the following error message "ImportError: libgnutls.so.26:
cannot open shared object file: No such file or directory". I don't
actually know why I'm getting this message as I've set the SAGE_ROOT
and LD_LIBRARY_PATH variables to the proper locations. I've set these
variables via python. Bellow is my (sample) code that was starting to
write when I came across this message.

====== START OF CODE =======

import sys
import os

os.environ.__setitem__('SAGE_ROOT', '/home/emerson/ProgramFiles/Sage')
os.environ.__setitem__('PATH', os.environ.__getitem__('SAGE_ROOT') +
':' + os.environ.__getitem__('PATH'))
os.environ.__setitem__('LD_LIBRARY_PATH',
os.environ.__getitem__('SAGE_ROOT')+'/local/lib')

# + os.environ.__getitem__('LD_LIBRARY_PATH') :/usr/lib/jvm/java-6-
sun-1.6.0.03/jre/lib/i386/client::/usr/lib/jvm/java-6-sun-1.6.0.03/jre/
lib/i386::/usr/lib/firefox/:/usr/lib/firefox/

print(os.environ.__getitem__('SAGE_ROOT'))
print(os.environ.__getitem__('PATH'))
print(os.environ.__getitem__('LD_LIBRARY_PATH'))

from sage.all import *

====== END OF CODE =======

If anyone could help me I'd appreciate. I'm really stuck at this :-(.

Thanks in advance.

----
Emerson

mabshoff

unread,
Jun 10, 2008, 2:52:16 PM6/10/08
to sage-support


On Jun 10, 9:49 am, Emerson <emerson.loure...@gmail.com> wrote:
> Hello everyone.

Hi Emerson,
You should either run "sage -sh" before starting eclipse or
alternatively "source local/bin/sage-env" from $SAGE_ROOT. Then PATH
and LD_LIBRARY_PATH should be set properly.

> Thanks in advance.
>
> ----
> Emerson

Cheers,

Michael

Emerson

unread,
Jun 17, 2008, 12:20:29 PM6/17/08
to sage-support
Hello Michael.

I've tried that, but unfortunately, it still didn't work. I found a
way of making it work, even though I'm not sure if it's the proper way
of doing it. Basically, on Eclipse, I create a new "Run Configuration"
that runs sage with the arguments "-python" and the path to your main
python file. On eclipse, hit the "Run" menu, then "External Tools",
then "Open External Tools Dialog". Then create a new run configuration
and set the "Location" field to the directory containing your sage bin
file and on the arguments put the following entries, in different
lines: "-python" and "${container_loc}/
YOUR_MAIN_PYTHON_FILE.py" (without the quotes, of course). It works
fine here, i get the output on eclipse console and everything, but as
I said, I don't know if that would be the best way of setting this up.
still, it works!!! I find this particularly useful, since using
eclipse gives a lot of nice stuff in a single place.

On Jun 10, 7:52 pm, mabshoff <Michael.Absh...@mathematik.uni-
Reply all
Reply to author
Forward
0 new messages