I might be lucky with my settings, but things seem to work very simply
on my machine. I have NOTHING sage-related in my $PATH, just a
symbolic link 'sage' in /usr/bin/ that points to the actual sage
command -- and then for standalone scripts i use
#!/usr/bin/env sage

it works fine!

btw the decision to have nothing in my path is because i had a version
of python installed before sage (like most linux users do!) and i want
to make sure the python scripts use this version (the older one) of
python. Just in case some day a sage upgrade modifies python in such a
way that traditional python scripts will not work properly. I wonder
what the recommendations are regarding this issue.






On 17 oct, 09:08, "William Stein" <[EMAIL PROTECTED]> wrote:
> On 10/16/07, Steffen <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > I tried to run the example in the sage tutorial:
>
> > #!/usr/bin/env sage-python
>
> Somebody made a serious mistake in the tutorial; it should be
>
> #!/usr/bin/env sage    -python
>
> I.e., *note* the space.
>
> See
>
>  SAGE_ROOT/examples/programming/standalone_scripts
>
> for examples (especially see the python subdirectory).
>
> I've fixed this mistake in the tutorial for the next Sage release.
>
> Many thanks for reporting this issue.
>
>  -- William
>
>
>
>
>
> > import sys
>
> > from sage.all import *
>
> > if len(sys.argv) != 2:
> >         print "Usage: %s <n>"%sys.argv[0]
> >         print "Outputs the prime factorization of n."
> >         sys.exit(1)
>
> > print factor(sage_eval(sys.argv[1]))
>
> > Running the script I get the following error:
> > /usr/bin/env: sage-python: file or directory not found
> > I have looked it up and the script env indeed does not offer the
> > parameter sage-python, but for example python. I am runnig a Suse10.0
> > and I have updated with sage -upgrade from 2.8.6 to 2.8.7. I have set
> > the PATH variable SAGE_ROOT to fooDir/sage-2.8.6-suse-i686-Linux.
>
> > Is there something wrong with my installation or did I make any
> > mistake?
>
> > Cheers, Steffen
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washingtonhttp://wstein.org


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-forum
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to