ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 18 Apr 2012 05:01:53 -0500Problem with Sage and system pythonhttp://ask.sagemath.org/question/8900/problem-with-sage-and-system-python/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.
Wed, 18 Apr 2012 03:45:58 -0500http://ask.sagemath.org/question/8900/problem-with-sage-and-system-python/Answer by kcrisman for <p>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)</p>
<p>ImportError: No module named scitools.all</p>
<p>But if I try to execute without Sage, I have no problem with loading the modules.</p>
http://ask.sagemath.org/question/8900/problem-with-sage-and-system-python/?answer=13473#post-id-13473This 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`.Wed, 18 Apr 2012 04:29:45 -0500http://ask.sagemath.org/question/8900/problem-with-sage-and-system-python/?answer=13473#post-id-13473Comment by niles for <p>This is by design, in fact. Sage uses (and builds) its <em>own</em> Python. So you shouldn't expect this.</p>
<p>However, my understanding is that</p>
<pre><code>sage -sh
easy_install scitools
</code></pre>
<p>should work, where the Sage Python is invoked in the Sage subshell. For some reason that didn't work for me, but </p>
<pre><code>sage -sh
easy_install brian
</code></pre>
<p>did, and I could use it in Sage, so the problem doesn't seem to be <code>easy_install</code>.</p>
http://ask.sagemath.org/question/8900/problem-with-sage-and-system-python/?comment=19896#post-id-19896related: 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.Wed, 18 Apr 2012 05:01:53 -0500http://ask.sagemath.org/question/8900/problem-with-sage-and-system-python/?comment=19896#post-id-19896