I'm not sure where to post this, but is it possible to run Sage without a GUI/notebook interface?

The idea is to be able to run Sage solely in the terminal so that I can detach from the Tmux session and have Sage compute for hours. With the notebook interface it ends up stopping after a few hours, and it's not as easy to run multiple instances in parallel.

If not, is there some Sage module for Python? I've tried importing the components that are built into Sage but they do not have all the functions that are available when actually using Sage. For example, using NetworkX allows me to have DiGraphs but not the specific functions I need that Sage offers.

  • 1
    $\begingroup$ Perhaps post this question to ask.sagemath.org $\endgroup$
    – Weaam
    Commented Oct 29, 2015 at 21:25

1 Answer 1


Sage was, in fact, originally a CLI-only program! Every version of Sage has a command line interface as part of it, except in the following two cases:

  • You are only using it at a Sage notebook server run by someone else.
  • You are using only the Sage cell server.

It doesn't sound like you are in those situations, though.

If you download a binary or build one from scratch, it includes the CLI. The SageMathCloud also includes command line access. If you are on Mac or Windows, the commenter is right that ask.sagemath.org should be searchable for how exactly to access it. On the Mac app it's fairly straightforward - you should be able to use the menu item on the upper right to ask for a Terminal session. Good luck!


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .