Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

location of sage -python executable

I wanted to know the path of the python interpreter that sage uses, so I executed

sage -python
Python 2.6.4 (r264:75706, Jun 20 2011, 12:34:18) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'/Users/tjfulle/Local/math/sage/darwin/local/bin/python'

Then, I navigate to /Users/tjfulle/Local/math/sage/darwin/local/bin to call the interpreter that sage uses directly:

./python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'/Users/tjfulle/Local/math/sage/darwin/local/bin/python'

The output from sys.executable is the same for each case, but clearly, the two interpreters are different, for sage -python, the interpreter is Python 2.6.4 and for /Users/tjfulle/Local/math/sage/darwin/local/bin/python the interpreter is Python 2.6.1.

Am I missing something? Which python interpreter is being used when I type sage -python?

When performing the same exercise on my redhat machine, when I execute /home/tjfulle/Local/math/sage/redhat/local/bin/python it returns

./python: error while loading shared libraries: libpython2.6.so.1.0: 
cannot open shared object file: No such file or directory

I'd like to use the python built in with sage, but call it directly bypassing the sage -python layer. Is this possible?