Ask Your Question

Revision history [back]

If the Sage app is at /Applications/SageMath-8.0.app, starting the Jupyter notebook with the option you want can be achieved by typing the following in a terminal.

$ /Applications/SageMath-8.0.app/Contents/Resources/sage/sage -n jupyter --ip '*'

(type everything that follows the $ prompt, but not the $ prompt itself).

To make this simpler, you could place a symbolic link to the Sage executable somewhere in your path. For this, type the following in a terminal

$ sudo ln -s /Applications/SageMath-8.0.app/Contents/Resources/sage/sage /usr/local/bin

and enter your password when asked to.

Explanation: ln -s TARGET LOCATION places a symbolic link to TARGET in LOCATION. Here the target is the Sage executable, /Applications/SageMath-8.0.app/Contents/Resources/sage/sage, and the location is /usr/local/bin. The command is called with sudo ("super-user do") because you need admin rights to write in /usr/local/bin.

From then on, you can call Sage in a terminal by just typing

$ sage

and you can launch the Jupyter notebook by typing

$ sage -n jupyter

and you can launch the Jupyter notebook accessible from all IP addresses by typing

$ sage -n jupyter --ip '*'

If in addition you type the following in a terminal,

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

then shortcuts to start GAP, PARI/GP, R, Singular, etc. will be placed in /usr/local/bin so that you can launch those by typing in a terminal:

$ gap
$ gp
$ R
$ singular

etc.