KeyError: SAGE_ROOT with 3-manifolds 10.8 binary [closed]
I'll preface this by admitting this would be a question if I hadn't already solved it by research. It is a known issue that, for example, typing help(some_command) in the 10.8 release of sagemath on some systems gets the KeyError: SAGE_ROOT message -- at the very least, the standard help system is broken. Since I have both 10.7 and 10.8 running on my Mac as I compare them for compatibility, I noted that this error is not present in 10.7. I looked at the startup scripts, and did some cursory comparisons, and saw that the way SAGE_ROOT is handled is more elaborate in 10.7 and that the environment variable is left blank in 10.8 if there are issues; that is what I was experiencing by, for example sage --root in the terminal in release 10.8. Doing the same in 10.7 led me to the solution I found.
The fix (at least in my case is to use the symlink in /var/tmp in the following way: Since I have both 10.7 and 10.8, the startup scripts in /usr/local/bin are called sage and sage10_7 (which was not overwritten when I installed the support package for the 10.8 release). I also have aliases in my own .login script, mainly for starting the jupyter notebook in a given directory. I edited those to do the following:
alias nbs7 "setenv SAGE_ROOT '/var/tmp/sage-10.7-current'; sage10_7 --notebook jupyter '/Eight/Fold/Path'"
and similarly for starting the notebook in release 10.8. I'm sure the developers had reasons for changing the startup scripts for the system, and I don't think what I've done is the worst kluge ever; for me it is sure easier than trying to figure out why my package could not find SAGE_ROOT by default. Other users report this issue (maybe with very different etiology from my particular issue). If I have a lingering question, it is asking whether there is a more 'standard' way of dealing with this issue. Obviously, if I were not concurrently running two versions, I could set-it-and-forget-it on the environment variable with one line in the .login. Thanks for reading, and for any suggestions you have.