Ask Your Question
2

Problem with Sage and system python

asked 2012-04-18 10:45:58 +0200

mikrosvinjo gravatar image

updated 2012-04-18 11:30:24 +0200

kcrisman gravatar image

I have a question regarding sage on macosx. My problem is that the precompiled binary package of sage doesn't see my python modules installed through macports. I mean sage is working without porblem, but when I try to attach a script which use a module (e.g. scitools) I got : Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/sage/misc/preparser.pyc in load(filename, globals, attach) 1629 1630 if fpath.endswith('.py'): -> 1631 execfile(fpath, globals) 1632 elif fpath.endswith('.sage'): 1633 exec(preparse_file(open(fpath).read()) + "\n", globals) Volumes/Henry/Script_py/plot/example.py in <module>() 2 import time, glob, os 3 4 # clean up old frames: 5 for name in glob.glob('tmp_*.eps'): 6 os.remove(name)

ImportError: No module named scitools.all

But if I try to execute without Sage, I have no problem with loading the modules.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-04-18 11:29:45 +0200

kcrisman gravatar image

This is by design, in fact. Sage uses (and builds) its own Python. So you shouldn't expect this.

However, my understanding is that

sage -sh
easy_install scitools

should work, where the Sage Python is invoked in the Sage subshell. For some reason that didn't work for me, but

sage -sh
easy_install brian

did, and I could use it in Sage, so the problem doesn't seem to be easy_install.

edit flag offensive delete link more

Comments

1

related: I don't know how to install (for Sage) python modules which *don't* use the easy_install approach. For example, http://www.shogun-toolbox.org provides a machine-learning C library with interfaces for python and other languages; I can install it and its python interface with macports, or by hand, but not with easy_install.

niles gravatar imageniles ( 2012-04-18 12:01:53 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-04-18 10:45:58 +0200

Seen: 584 times

Last updated: Apr 18 '12