ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 22 Jun 2016 05:00:24 +0200About Document "Environment variables used by Sage"https://ask.sagemath.org/question/33862/about-document-environment-variables-used-by-sage/ In these environment variables mentioned in sage document "Environment variables used by Sage", "DOT_SAGE" is the only one valid variable in Sagemath 7.2. The document should be updated.
BTW, the init.sage script still do not work. Is there a way to setup start up script in jupyter notebook for sage kernel?Mon, 20 Jun 2016 18:36:31 +0200https://ask.sagemath.org/question/33862/about-document-environment-variables-used-by-sage/Answer by danny for <p>In these environment variables mentioned in sage document "Environment variables used by Sage", "DOT_SAGE" is the only one valid variable in Sagemath 7.2. The document should be updated.</p>
<p>BTW, the init.sage script still do not work. Is there a way to setup start up script in jupyter notebook for sage kernel?</p>
https://ask.sagemath.org/question/33862/about-document-environment-variables-used-by-sage/?answer=33872#post-id-33872I find that many environment variables are stored in variable SAGE_ENV. For the question of start up script, the init.sage file do work in command line mode, and not work for sage notebook.
For Jupyter notebook, we can setup start up script in the following way:
In [1]: profile = get_ipython().profile_dir.location
In [2]: %%writefile $profile/startup/start.ipy
...some codes you want to run...
Note: the codes are executed for python2 kernel and sagemath kernel
Tue, 21 Jun 2016 18:18:32 +0200https://ask.sagemath.org/question/33862/about-document-environment-variables-used-by-sage/?answer=33872#post-id-33872Answer by John Palmieri for <p>In these environment variables mentioned in sage document "Environment variables used by Sage", "DOT_SAGE" is the only one valid variable in Sagemath 7.2. The document should be updated.</p>
<p>BTW, the init.sage script still do not work. Is there a way to setup start up script in jupyter notebook for sage kernel?</p>
https://ask.sagemath.org/question/33862/about-document-environment-variables-used-by-sage/?answer=33875#post-id-33875I disagree with your assertion that `DOT_SAGE` is the only valid variable listed [here](http://doc.sagemath.org/html/en/reference/repl/environ.html). All but one of the listed variables are still valid, most used by either `local/bin/sage-env` or by `src/sage/env.py`:
- `DOT_SAGE`: yes, see both `sage-env` and `env.py`
- `SAGE_RC_FILE`: yes, see `sage-env`
- `SAGE_STARTUP_FILE`: yes, see both `sage-env` and `env.py`
- `SAGE_SERVER`: yes, but only used when downloading packages: see `build/sage_bootstrap/mirror_list.py`.
- `SAGE_PATH`: yes, see `sage-env`
- `SAGE_BROWSER`: yes, see `src/misc/viewer.py`; I think it also gets used by the old Sage notebook
- `SAGE_ORIG_LD_LIBRARY_PATH_SET`, `SAGE_ORIG_DYLD_LIBRARY_PATH_SET`: yes, see `src/repl/interpreter.py`.
- `SAGE_CBLAS`: I'm not sure about this one; it may not be valid anymore.
See also http://doc.sagemath.org/html/en/installation/source.html#environment-variables for environment variables used when compiling Sage.Tue, 21 Jun 2016 22:24:46 +0200https://ask.sagemath.org/question/33862/about-document-environment-variables-used-by-sage/?answer=33875#post-id-33875Comment by danny for <p>I disagree with your assertion that <code>DOT_SAGE</code> is the only valid variable listed <a href="http://doc.sagemath.org/html/en/reference/repl/environ.html">here</a>. All but one of the listed variables are still valid, most used by either <code>local/bin/sage-env</code> or by <code>src/sage/env.py</code>:</p>
<ul>
<li><code>DOT_SAGE</code>: yes, see both <code>sage-env</code> and <code>env.py</code> </li>
<li><code>SAGE_RC_FILE</code>: yes, see <code>sage-env</code> </li>
<li><code>SAGE_STARTUP_FILE</code>: yes, see both <code>sage-env</code> and <code>env.py</code></li>
<li><code>SAGE_SERVER</code>: yes, but only used when downloading packages: see <code>build/sage_bootstrap/mirror_list.py</code>.</li>
<li><code>SAGE_PATH</code>: yes, see <code>sage-env</code></li>
<li><code>SAGE_BROWSER</code>: yes, see <code>src/misc/viewer.py</code>; I think it also gets used by the old Sage notebook</li>
<li><code>SAGE_ORIG_LD_LIBRARY_PATH_SET</code>, <code>SAGE_ORIG_DYLD_LIBRARY_PATH_SET</code>: yes, see <code>src/repl/interpreter.py</code>.</li>
<li><code>SAGE_CBLAS</code>: I'm not sure about this one; it may not be valid anymore.</li>
</ul>
<p>See also <a href="http://doc.sagemath.org/html/en/installation/source.html#environment-variables">http://doc.sagemath.org/html/en/insta...</a> for environment variables used when compiling Sage.</p>
https://ask.sagemath.org/question/33862/about-document-environment-variables-used-by-sage/?comment=33877#post-id-33877Thanks for your answer. I mean that those variables can not be called directly in sage notebook except DOT_SAGE. In my answer above, I have said that the variable is available by variable SAGE_ENV, which is set in sage-env.Wed, 22 Jun 2016 01:29:00 +0200https://ask.sagemath.org/question/33862/about-document-environment-variables-used-by-sage/?comment=33877#post-id-33877Comment by John Palmieri for <p>I disagree with your assertion that <code>DOT_SAGE</code> is the only valid variable listed <a href="http://doc.sagemath.org/html/en/reference/repl/environ.html">here</a>. All but one of the listed variables are still valid, most used by either <code>local/bin/sage-env</code> or by <code>src/sage/env.py</code>:</p>
<ul>
<li><code>DOT_SAGE</code>: yes, see both <code>sage-env</code> and <code>env.py</code> </li>
<li><code>SAGE_RC_FILE</code>: yes, see <code>sage-env</code> </li>
<li><code>SAGE_STARTUP_FILE</code>: yes, see both <code>sage-env</code> and <code>env.py</code></li>
<li><code>SAGE_SERVER</code>: yes, but only used when downloading packages: see <code>build/sage_bootstrap/mirror_list.py</code>.</li>
<li><code>SAGE_PATH</code>: yes, see <code>sage-env</code></li>
<li><code>SAGE_BROWSER</code>: yes, see <code>src/misc/viewer.py</code>; I think it also gets used by the old Sage notebook</li>
<li><code>SAGE_ORIG_LD_LIBRARY_PATH_SET</code>, <code>SAGE_ORIG_DYLD_LIBRARY_PATH_SET</code>: yes, see <code>src/repl/interpreter.py</code>.</li>
<li><code>SAGE_CBLAS</code>: I'm not sure about this one; it may not be valid anymore.</li>
</ul>
<p>See also <a href="http://doc.sagemath.org/html/en/installation/source.html#environment-variables">http://doc.sagemath.org/html/en/insta...</a> for environment variables used when compiling Sage.</p>
https://ask.sagemath.org/question/33862/about-document-environment-variables-used-by-sage/?comment=33878#post-id-33878They are not intended to be "called directly". They are environment variables, which means that if they are set, they are accessible from Python via `os.environ['DOT_SAGE']`, etc. The variable `SAGE_ENV` carries some of the same information, some different information. Most of the settings in `SAGE_ENV` are not meant to be customized directly, whereas you are welcome to change the value of `SAGE_STARTUP_FILE` (for example) in your shell.Wed, 22 Jun 2016 05:00:24 +0200https://ask.sagemath.org/question/33862/about-document-environment-variables-used-by-sage/?comment=33878#post-id-33878