Packages and Features

Standard Packages

The Sage distribution includes most programs and libraries on which Sage depends. It installs them automatically if it does not find equivalent system packages.

FC

Fortran compiler command passed to ./configure.

Mathematics

Front-end, graphics, document preparation

Other dependencies

Optional Packages

For additional functionality, you can install some of the following optional packages.

Mathematics

Front-end, graphics, document preparation

Other dependencies

Installing Optional Packages

To install an optional package, you can use Sage’s package management system.

Basic Installation

To install an optional package when building Sage from source, enable it during configuration and then run make:

./configure --enable-<package_name>=yes
make

For example, to enable the optional package \(bliss\):

./configure --enable-bliss=yes
make

To see all available configure options:

./configure --help

For Python packages that are not part of Sage-the-distribution, use pip:

./sage --pip install <package_name>

Note

The legacy sage -i command is obsolete and should not be used. Use the ./configure and make approach for Sage packages, and ./sage --pip install for external Python packages.

If you installed SageMath through Conda, a system package manager, or another distribution, use the package manager of your installation instead (e.g., conda install, apt install, brew install). Some Sage data packages are available on PyPI as sage-data-* packages. For example, to install the Cremona elliptic curve database:

python -m pip install sage-data-elliptic-curves

For instructions specific to your setup, see the Sage installation guide.

Using the Package List

To see a list of all available optional packages, run in a system terminal:

sage --optional

To list experimental packages instead:

sage --experimental

For more detailed information on listing packages, including how to list pip-installed packages, see the documentation for the sage.misc.package module.

Alternatively, inside Sage you can use:

from sage.misc.package import list_packages
list_packages('optional', local=True)     # Lists optional packages
list_packages('experimental', local=True) # Lists experimental packages

Note

Use local=True to avoid network lookups to PyPI, which may fail for some Sage package names.

Installation from Source

When installing from source, you can enable specific optional packages during the build process. For example, to enable the \(bliss\) package:

./configure --enable-bliss=yes
make

To see all available configure options:

./configure --help

Pip-Installable Optional Packages

Some optional SageMath packages can be installed using pip:

./sage --pip install <package_name>

For example, to install the \(graph-genus\) package (which provides faster graph genus algorithms):

./sage --pip install graph-genus

This method is particularly useful for Python packages that are not distributed as standard Sage packages.

Verifying Installation

To verify that an optional package was installed correctly, you can check Sage’s package records:

from sage.misc.package import list_packages
pkgs = list_packages('optional', local=True)
pkgs['bliss'].is_installed()   # True if installed

To check whether the functionality is actually available, use the corresponding sage.features check. For example, for \(bliss\):

from sage.features.bliss import Bliss
Bliss().is_present()   # True if the feature is available

For instructions on installing optional packages using your system’s package manager (Homebrew, apt, dnf, etc.), see the individual package pages linked below. Each package page includes the correct package names for your distribution.

Note

Some optional packages may have additional system dependencies. See All External Packages for more information.

Features

Distribution Packages of the Sage Library

Experimental Packages

Some packages that provide additional functionality are marked as “experimental”. Developers are needed in order to improve the integration of these packages into the Sage distribution.

Mathematics

Other dependencies

All External Packages