On Tue, Nov 6, 2018 at 1:00 PM Timo Kaufmann <eisfre...@gmail.com> wrote: > > I've had similar thoughts for a while. Replacing sage-env with a dumb config > file that can be parsed from within python would go a long way. I'm not too > familiar with the native sage-env however, it might do some clever stuff that > a dumb config file couldn't do.
I'm not necessary suggesting a full replacement: Just a dumb config in addition to it that can be used both from sage.env and perhaps sage-env as well. I tossed about some ideas for this in https://trac.sagemath.org/ticket/22652 and possibly elsewhere, but never really made progress on it. I think the one "new" point I'm making here is that `import sage` should *just work* without having to set any special environment variables :/ > Am Dienstag, 6. November 2018 11:10:52 UTC+1 schrieb Erik Bray: >> >> On Mon, Nov 5, 2018 at 8:11 AM Jori Mäntysalo <jori.ma...@uta.fi> wrote: >> > >> > I am trying to marry SageMath and Jupyterhub. I think I got them engaged, >> > but the wedding night has a problem: >> > >> > Error: You must set the SAGE_ROOT environment variable or run this >> > script from the SAGE_ROOT or SAGE_ROOT/local/bin/ directory. >> > Error setting environment variables by sourcing >> > '/home/jupkernelit/sage-8.4/local/bin/sage-env'; >> > possibly contact sage-devel (see >> > http://groups.google.com/group/sage-devel) >> > >> > First I think that I just set SAGE_ROOT in the command line before >> > jupytehub-command, set it with export-command, or put it to /etc/profile. >> > They all failed, so jupyterhub seems to ignore environment. >> > >> > What next? >> >> Perhaps only loosely related, and not immediately helpful to your >> problem, but something I've been thinking about for a while: I think >> it's rather unfortunate that Sage-the-library (aka sagelib) requires >> certain environment variables to be set in order to work at all. I >> think sagelib--specifically the sage.env module--should try to >> automatically set `SAGE_ROOT` and other variables that derive from it >> if they aren't already set. >> >> Currently sagelib will just crash at import time with an unhelpful >> traceback if at least SAGE_ROOT and SAGE_LOCAL are not set. Honestly, >> in most cases, it can make some reasonable guesses about this. I also >> thought we might be able to include an optional config file for many >> of these variables which might be searched for in a few common >> locations. The first place to look might be installed alongside the >> sage package itself. System packagers could include their own copy of >> this file in the package so that all the key variables (e.g. >> SAGE_ROOT, SAGE_SRC, SAGE_DOC, etc.) are set appropriately for however >> Sage is packaged on that system. IIRC Numpy does something a bit >> similar, but for different reasons. > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-devel+unsubscr...@googlegroups.com. > To post to this group, send email to sage-devel@googlegroups.com. > Visit this group at https://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.