Installing shortcut scripts#

sage.misc.dist.install_scripts(directory=None, ignore_existing=False)#

This function has been deprecated.

Running install_scripts(directory) creates scripts in the given directory that run various software components included with Sage. Each of these scripts essentially just runs sage --CMD where CMD is also the name of the script:

  • ‘gap’ runs GAP

  • ‘gp’ runs the PARI/GP interpreter

  • ‘ipython’ runs IPython

  • ‘maxima’ runs Maxima

  • ‘mwrank’ runs mwrank

  • ‘R’ runs R

  • ‘singular’ runs Singular

  • ‘sqlite3’ runs SQLite version 3

This command:

  • verbosely tells you which scripts it adds, and

  • will not overwrite any scripts you already have in the given directory.

INPUT:

  • directory - string; the directory into which to put the scripts. This directory must exist and the user must have write and execute permissions.

  • ignore_existing - bool (optional, default False): if True, install script even if another version of the program is in your path.

OUTPUT: Verbosely prints what it is doing and creates files in directory that are world executable and readable.

Note

You may need to run sage as root in order to run install_scripts successfully, since the user running sage needs write permissions on directory. Note that one good candidate for directory is '/usr/local/bin', so from the shell prompt, you could run

sudo sage -c "install_scripts('/usr/local/bin')"

Note

Running install_scripts(directory) will be most helpful if directory is in your path.

AUTHORS:

  • William Stein: code / design

  • Arthur Gaer: design

  • John Palmieri: revision, 2011-07 (github issue #11602)

EXAMPLES:

sage: import tempfile
sage: from sage.misc.dist import install_scripts
sage: with tempfile.TemporaryDirectory() as d:
....:     install_scripts(d, ignore_existing=True)
doctest:warning...
the function install_scripts has been deprecated and will be removed in a future version of Sage
See https://github.com/sagemath/sage/issues/30207 for details.
Checking that Sage has the command 'gap' installed
...