Welcome to the Sage Installation Guide!#
If you are reading this manual at https://doc.sagemath.org/, note that it was built at the time the most recent stable release of SageMath was made.
More up-to-date information and details regarding supported platforms may have become available afterwards and can be found in the section “Availability and installation help” of the release tour for each SageMath release.
Where would you like to run SageMath? Pick one of the following sections.
macOS#
Do you want to do SageMath development?
Yes, development:
Obtain the SageMath sources via
git
as described in The Sage Developer’s Guide.Then build SageMath from source as described in section Install from Source Code.
Alternatively, follow the instructions in section Using conda to provide all dependencies for the Sage library (experimental); these describe an experimental method that gets all required packages, including Python packages, from conda-forge.
No development:
Install the binary build of SageMath from the 3-manifolds project. It is a signed and notarized app, which works for macOS 10.12 and newer. It is completely self-contained and provides the standard Sage distribution together with many optional packages. Additional optional Python packages can be installed with the
%pip
magic command and will go into your~/.sage
directory.Alternatively, install SageMath from the conda-forge project, as described in section Install from conda-forge.
Alternatively, build SageMath from source as described in section Install from Source Code.
Windows#
Do you want to do SageMath development?
Yes, development:
Enable Windows Subsystem for Linux (WSL) by following the official WSL setup guide. Be sure to do the steps to install WSL2 and set it as default. Then go to the Microsoft Store and install Ubuntu (or another Linux distribution). Start Ubuntu from the start menu.
Then follow the instructions for development on Linux below.
No development:
Enable Windows Subsystem for Linux (WSL) by following the official WSL setup guide. Be sure to do the steps to install WSL2 and set it as default. Then go to the Microsoft Store and install Ubuntu (or another Linux distribution). Start Ubuntu from the start menu.
On the Linux running on WSL, you always have root access, so you can use any of the installation methods described below for Linux.
Linux#
Do you want to do SageMath development?
Yes, development:
Obtain the SageMath sources via
git
as described in The Sage Developer’s Guide.Then build SageMath from source as described in section Install from Source Code.
Alternatively, follow the instructions in section Using conda to provide all dependencies for the Sage library (experimental); these describe an experimental method that gets all required packages, including Python packages, from conda-forge.
No development: Do you have root access (sudo)?
Yes, root access: Then the easiest way to install SageMath is through a Linux distribution that provides it as a package. Most major Linux distributions have up-to-date versions of SageMath, see repology.org: sagemath for an overview. See Linux package managers for additional information.
If you are on an older version of your distribution and a recent version of SageMath is only available on a newer version of the distribution, consider upgrading your distribution. In particular, do not install a version of Sage older than 9.2.
No root access, or on an older distribution Install SageMath from the conda-forge project, as described in section Install from conda-forge.
Alternatively, build SageMath from source as described in section Install from Source Code.
In the cloud#
CoCalc: an online service that provides SageMath and many other tools.
On any system that allows you to bring your own Docker images to run in a container: Use the Docker image sagemathinc/cocalc or another Docker image providing SageMath.
Sage Cell Server: an online service for elementary SageMath computations.
More information:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License.