#12161: Make Sage App on Mac work right all the time on OS X Lion
----------------------------+-----------------------------------------------
Reporter: kcrisman | Owner: tbd
Type: defect | Status: new
Priority: major | Milestone: sage-5.0
Component: distribution | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
----------------------------+-----------------------------------------------
Comment(by iandrus):
Replying to [comment:3 GeorgSWeber]:
> Sorry,
>
> I do know how to properly attach patches to trac, of course. But I don't
know either how soon I get around to find enough time to do so. And the
one-liner in the comment above (add to the extcode hg repo, or in a "live
install" to the file "start-sage-sh" under /Applications/Sage-
xyz/Contents/Resources/sage) was simply too tempting to be kept entirely
unposted.
I'm happy to make a patch (it will be up in a few minutes). In fact if
this fixes it, I'll reach out through the internet and give you a big kiss
(or cup of coffee whichever you prefer :-)
> The story: In this "start-sage.sh" when called in a fresh install, the
directory "$DOT_SAGE/sage_notebook.sagenb" is checked for existence and
will not exist. Then (and only then) some different means to start up the
Notebook server is chosen, by some call to Terminal. Under OS X Lion, it
seems this way leads to some strange re-sorting of the entries in PATH
variable (which had been properly set before in "start-sage.sh"). As a
result, /usr/bin/python is called instead of Sage's python --- hence the
failures to find "_socket" and "IPython"!
> The one line added cares for when sage-env is sourced a second time
(which is the case), the environment variables are set again (which
wouldn't be done if SAGE_ENV is kept set to "1"), including PATH now being
what we want.
I would have thought is was impossible to pass environment variables via
the applescript. I just checked it however and it depends on if
Terminal.app was already started. If it was then the variables aren't
"passed". If the call to osascript opens Terminal.app though, it does
inherit the variables from the environment. This is just weird, but does
make sense in a way.
> Once the Notebook server has started once up (where the user has to set
in the terminal the admin password and such), the one directory checked
for exists, and the a different codepath is taken (which works without
changes).
This explains why I (and others) could never reproduce this. It was
because we all had sage notebooks already. And when I did test with no
notebook, my PATH was such that it didn't cause problems.
I just hope this is the only problem.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12161#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
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-trac?hl=en.