Ask Your Question

Revision history [back]

Try installing with the sagemath-forge Conda distribution:

This is a repost from an original post on sage-devel answering a similar question:

Run the following commands in a terminal (careful, no spaces around "="). The $ at the start of each line represents the prompt, do not type it.

$ INSTALL_LOCATION=$HOME  # or your choice of location
$ SITE='https://github.com'
$ DIRS='isuruf/sagemath-forge/releases/latest/download'
$ FILE="sagemath-forge-$(uname)-$(uname -m).sh"
$ cd $INSTALL_LOCATION
$ curl -L -O $SITE/$DIRS/$FILE
$ bash $FILE

The script then asks a few questions; answering "yes" each time might work well.

Once sagemath-forge is installed, the underlying Conda can be activated or deactivated; activating it changes the PATH to include /path/to/sagemath-forge/bin where the executables installed by Conda are located.

So, to use the version of Sage installed via Conda:

$ conda activate

$ which sage
/path/to/sagemath-forge/bin/sage

$ sage
│ SageMath version 9.4, Release Date: 2021-08-22
│ Using Python 3.8.12. Type "help()" for help.
sage: %colors Linux
sage: 2 * 3 * 337
2022
sage: quit
Exiting Sage (CPU time 0m0.12s, Wall time 0m16.08s).

$ conda deactivate

To start Jupyter notebook or JupyterLab:

$ conda activate
$ jupyter notebook
$ jupyter lab
$ conda deactivate

To make Conda always active, add the line

$ conda activate

to a file that gets sourced every time you start a shell (e.g. in $HOME/.bash_profile if you use bash, or in the corresponding zsh file if you use zsh as your shell).