Building several versions of SageMath on macOS
does not seem to install a Jupyter kernel for each,
maybe because each new build sees a Jupyter kernel
for Sage already exists at the desired location.
Maybe this is something we should improve. In any
case thanks for asking, and here are, at least,
some ways to sort this out "by hand".
To figure out where your kernels are installed, run:
$ sage --jupyter kernelspec list
This might answer something like:
Available kernels:
python3 /Users/name/Library/Jupyter/kernels/python3
sagemath /Users/name/Library/Jupyter/kernels/sagemath
To change what the SageMath kernel is doing, you can edit
the file
/Users/name/Library/Jupyter/kernels/sagemath/kernel.json
To have a Jupyter kernel for each SageMath version,
you can rename or duplicate the folder and create:
/Users/name/Library/Jupyter/kernels/sagemath-8.9
/Users/name/Library/Jupyter/kernels/sagemath-9.0
and edit the `kernel.json` files in there.
These `kernel.json` files might look something like:
```
{
"argv":
[
"/path/to/sagemath/local/bin/sage",
"--python",
"-m",
"sage.repl.ipython_kernel",
"-f", "{connection_file}"
],
"display_name": "SageMath 9.0",
"language": "sage"
}
```
So fixing it is just a matter of changing the path
in the first item of the "argv" list.
Make sure to use different "display_name" values
for the different kernels you install there.
Initially they will say
"display_name": "SageMath",
so maybe use
"display_name": "SageMath-8.9",
and
"display_name": "SageMath-9.0",
to make them different.
If you would prefer to copy Sage's actual Jupyter kernel
than making up your own, you can locate it in the Sage
tree as follows.
Change to your Sage folder (repeat for each version of Sage,
replacing `/path/to/sagemath` with the actual folder for it):
$ cd /path/to/sagemath
$ find . -name "kernel.json"
This will give you a result like:
./local/share/jupyter/kernels/python3/kernel.json
./local/share/jupyter/kernels/sagemath/kernel.json
You can then copy `./local/share/jupyter/kernels/sagemath`
to say `/Users/name/Library/Jupyter/kernels/sagemath-x.y` --
use the folder revealed by `sage --jupyter kernelspec list`
and rename to `sagemath-9.0` or `sagemath-8.9` as you wish.
Hope this helps. Kind regards, --Samuel