Install from conda-forge #
$ curl -L -O " https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3- $( uname ) - $( uname -m ) .sh" $ bash Miniforge3- $( uname ) - $( uname -m ) .sh
Miniforge (and Mambaforge) use conda-forge as the default channel. If you are using Miniconda or Anaconda, set it up to use conda-forge: Add the conda-forge channel: conda config --add channels conda-forge Change channel priority to strict: conda config --set channel_priority strict
Installing all of SageMath from conda (not for development) #
$ mamba create -n sage sage python = X
$ conda create -n sage sage python = X
Enter the new environment: conda activate sage Start SageMath: sage
Using conda to provide system packages for the Sage distribution #
Create a new conda environment including all standard packages recognized by sage, and activate it: $ conda env create --file environment-3.11-linux.yml --name sage-build $ conda activate sage-build
If you use a different architecture, replace
linux by
macos . Alternatively, use
environment-optional-3.11-linux.yml in place of
environment-3.11-linux.yml to create an environment with all standard and optional packages recognized by sage.
A different Python version can be selected by replacing
three point one one by
three point nine or
three point one zero in these commands.
Then the SageMath distribution will be built using the compilers provided by Conda and using many packages installed by Conda: $ ./ bootstrap $ ./ configure --with-python=$CONDA_PREFIX/bin/python \ --prefix=$CONDA_PREFIX $ make
Using conda to provide all dependencies for the Sage library #
Optionally, set the build parallelism for the Sage library. Use whatever the meaningful value for your machine is - no more than the number of cores:
$ export SAGE_NUM_THREADS=24
Create and activate a new conda environment with the dependencies of Sage and a few additional developer tools: .. tab:: mamba .. code-block:: shell $ mamba env create --file src/environment-dev-3.11-linux.yml --name sage-dev $ conda activate sage-dev .. tab:: conda .. code-block:: shell $ conda env create --file src/environment-dev-3.11-linux.yml --name sage-dev $ conda activate sage-dev
Alternatively, you can use
src/environment-3.11-linux.yml or
src/environment-optional-3.11-linux.yml , which will only install standard (and optional) packages without any additional developer tools.
A different Python version can be selected by replacing
three point one one by
three point nine or
three point one zero in these commands.
Bootstrap the source tree and install the build prerequisites and the Sage library: $ ./ bootstrap $ pip install --no-build-isolation -v -v --editable ./ pkgs/sage-conf_conda ./pkgs/sage-setup $ pip install --no-build-isolation --config-settings editable_mode=compat -v -v --editable ./ src
Verify that Sage has been installed: $ sage -c 'print(version())' SageMath version 10.2.beta4, Release Date: 2023-09-24
$ pip install --no-build-isolation --config-settings editable_mode=compat -v -v --editable src
$ mamba env update --file src/environment-dev-3.11-linux.yml --name sage-dev
$ pip install --no-build-isolation -v -v --editable ./ pkgs/sage-docbuild
$ sage --docbuild all html