On May 23, 12:50 am, Robert Bradshaw <[email protected]>
wrote:

> That's almost certainly testing your system Python.
>
> Try the above using the python inside $SAGE_ROOT/local/bin and see if  
> it gives anything different. The interesting part will be the  
> traceback it gives (or not).
>
> - Robert
>
It was using Sage Python - before executing ./python I did a
cd /space3/sage/space/software/Source/sage/sage-4.4.2/local/bin
which is where Sage installed Python.
Slackware Python: python --version gives Python 2.6.2
Sage Python: ./python --version gives Python 2.6.4

I have rerun the test by calling the Sage Python explicitly thus:
/space3/sage/space/software/Source/sage/sage-4.4.2/local/bin/python --
version gives Python 2.6.4

Same result - hashlib and zlib load OK.
Cheers, Peter

test script results showing version of Python used - i.e. Sage Python:
Working directory: /space3/sage/space/software/Source/sage/sage-4.4.2/
local/bin
Sage Python : Python 2.6.4
which /space3/sage/space/software/Source/sage/sage-4.4.2/local/bin/
python : /space3/sage/space/software/Source/sage/sage-4.4.2/local/bin/
python
Slackware Python : Python 2.6.2
which python : /usr/bin/python
hashlib imported
zlib imported
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named totalrubbish
totalrubbish module failed to import

test script test.sh
#!/bin/bash

cd /space3/sage/space/software/Source/sage/sage-4.4.2/local/bin
echo -n "Working directory: "
pwd

echo -n "Sage Python : "
/space3/sage/space/software/Source/sage/sage-4.4.2/local/bin/python --
version
echo -n "which /space3/sage/space/software/Source/sage/sage-4.4.2/
local/bin/python : "
which /space3/sage/space/software/Source/sage/sage-4.4.2/local/bin/
python

echo -n "Slackware Python : "
python --version
echo -n "which python : "
which python

/space3/sage/space/software/Source/sage/sage-4.4.2/local/bin/python -c
"import hashlib"
if [ $? -eq 0 ]; then
   echo "hashlib imported"
else
   echo "hashlib module failed to import"
fi

/space3/sage/space/software/Source/sage/sage-4.4.2/local/bin/python -c
"import zlib"
if [ $? -eq 0 ]; then
   echo "zlib imported"
else
   echo "zlib module failed to import"
fi

/space3/sage/space/software/Source/sage/sage-4.4.2/local/bin/python -c
"import totalrubbish"
if [ $? -eq 0 ]; then
   echo "totalrubbish imported"
else
   echo "totalrubbish module failed to import"
fi




test script modified to show Sage and Slackware Pythons

-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to