Ask Your Question

Problem with Sage and system python

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

mikrosvinjo gravatar image

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

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/ 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/ 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

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

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



related: I don't know how to install (for Sage) python modules which *don't* use the easy_install approach. For example, 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 +0100 )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


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

Seen: 571 times

Last updated: Apr 18 '12