Ask Your Question

Why does Sage use its own build of Python interpreter

asked 2021-03-19 14:34:29 +0200

greatpet gravatar image

updated 2021-03-19 20:26:01 +0200

slelievre gravatar image

Why can't I install Sage as a package in an existing Python environment, when every other Python package can be used in this way? How is Sage's bundled Python interpreter different from a normal Python interpreter?

edit retag flag offensive close merge delete


Welcome to Ask Sage! Thank you for your question.

slelievre gravatar imageslelievre ( 2021-03-19 17:29:20 +0200 )edit

The question would be easier to answer with an indication of

  • the operating system
  • the existing Python environment (from the operating system's package distribution? from Conda? other?)
slelievre gravatar imageslelievre ( 2021-03-19 17:29:49 +0200 )edit

The usual spelling is Sage rather than SAGE.

slelievre gravatar imageslelievre ( 2021-03-19 20:22:53 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-03-19 17:37:16 +0200

slelievre gravatar image

updated 2021-03-19 17:37:47 +0200

You ask:

Why can't I install Sage as a package in an existing Python environment

In fact you can, in many cases.

Sage is a huge Python library with many non-Python dependencies.

Historically, the way to make all these dependencies work together was to provide a complete distribution.

Tremendous effort has since been put into modularising it and packaging it for various distributions.

In Arch, Conda, Debian, Fedora, Gentoo, Guix, Nix, and other distributions, you can install Sage to work with the distribution's Python.

Modularisation efforts are ongoing to make Sage even more modular and easier to install for an existing Python installation.

This work is tracked at

edit flag offensive delete link more


That's nice to here! I was under the impression (probably mistakenly) that SAGE required python to be compiled with non-standard gcc flags different from a normal python build. Is it possible for SAGE to work with Python3 from the package manager of Ubuntu 20.04?

greatpet gravatar imagegreatpet ( 2021-03-19 18:22:23 +0200 )edit

Sage works with a very standard Python

When building Sage from source, one can decide to use the system Python or to build Python.

To install Sage for your system's Python with your system's package manager, run this in a terminal:

sudo apt install sagemath sagemath-jupyter sagemath-doc

or install these packages using the Ubuntu package manager application.

slelievre gravatar imageslelievre ( 2021-03-19 20:21:48 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2021-03-19 14:34:29 +0200

Seen: 70 times

Last updated: Mar 19