Sounds good.  However, I don't think that modifying sage-env, as the
trac ticket suggests, will fix things for the issue I'm discussing
here.  I changed the appropriate line of sage-env to

PYTHONPATH="$SAGE_PATH:$SAGE_ROOT/local/lib/python:$SAGE_PYTHONPATH"
&& export PYTHONPATH

which works, meaning whatever is in my SAGE_PYTHONPATH shows up in
sys.path in Sage.  However, it doesn't make my doctests work. Just to
check, I put

    sage: import sys
    sage: sys.path

in a docstring (with a blank line following), and so sys.path is spit
out by one of the errors.  It doesn't include the contents of my
SAGE_PYTHONPATH.  If you know where the PYTHONPATH is set for 'sage -
t', could you add a request to modify that in the trac ticket too?

-David


On Aug 30, 8:56 pm, mabshoff <[EMAIL PROTECTED]> wrote:
> On Aug 30, 8:51 pm, David Ketcheson <[EMAIL PROTECTED]> wrote:
>
> > Apparently the problem here (what I should have thought of first) is
> > that the directory containing foo.py is not in my sage python path.
> > The surprising (to me) part, and the reason I didn't think of it, is
> > that this breaks things even if  the file I'm testing is foo.py and I
> > try 'from foo import *'.  So it seems the only remedy (for now, since
> > I understand SAGE overrides my PYTHONPATH variable) is something like
>
> >     sage: import sys
> >     sage: mypath= '/mydir/'
> >     sage: if mypath not in sys.path: sys.path.append(mypath)
>
> > where /mydir/ is the path to foo.py.  This works, but doesn't seem
> > like a good solution, and is, I think, another good reason to allow
> > the user to modify sage's startup pythonpath.
>
> Yeah, this is #3784 and is trivial to fix. Maybe somebody will do it
> during the doc day right now.
>
> > -David
>
> Cheers,
>
> Michael
>
> <SNIP>
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to