Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

When you start the python executable, it looks for the libpython2.6.so.1.0 shared library which contains the "interesting" parts of the Python language. When you run /home/tjfulle/Local/math/sage/redhat/local/bin/python as opposed to sage -python, the Python executable picks up the system version of libpython2.6.so.1.0. For example, here is the output of ldd /opt/sage/local/bin/python on my machine:

...
libpython2.6.so.1.0 => /usr/lib/libpython2.6.so.1.0 (0x00007f32d5c19000)
...

See how it is using the "system" libpython2.6.so.1.0. When you run sage -python, it runs that same copy of Python in a "Sage environment" which primarily changes the paths where the shared libraries get looked up. If I do sage -sh and then do ldd /opt/sage/local/bin/python, I get

libpython2.6.so.1.0 => /opt/sage/local/lib/libpython2.6.so.1.0 (0x00007f499c1d8000)

When you start the python executable, it looks for the libpython2.6.so.1.0 shared library which contains the "interesting" parts of the Python language. When you run /home/tjfulle/Local/math/sage/redhat/local/bin/python as opposed to sage -python, the Python executable picks up the system version of libpython2.6.so.1.0. For example, here is the output of ldd /opt/sage/local/bin/python on my machine:

...
libpython2.6.so.1.0 => /usr/lib/libpython2.6.so.1.0 (0x00007f32d5c19000)
...

See how it is using the "system" libpython2.6.so.1.0. When you run sage -python, it runs that same copy of Python in a "Sage environment" which primarily changes the paths where the shared libraries get looked up. If I do sage -sh and then do ldd /opt/sage/local/bin/python, I get

...
libpython2.6.so.1.0 => /opt/sage/local/lib/libpython2.6.so.1.0 (0x00007f499c1d8000)
...

You are seeing the error on your RedHat machine since it doesn't have a libpython2.6 shared library to load.

If you want to use Sage's version of Python directly, then you have to have the appropriate enviroment variables set up so that it can find the needed libraries. The easiest way to do this is to run sage -sh to go into a shell with the environment variables set up or to source $SAGE_ROOT/local/bin/sage-env to set the variables directly in the current shell.