Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here's one way to use Emacs' Grand Unified Debugger (GUD) with the Sage library:

  • Ensure sage is in the PATH.
  • cd SAGE_ROOT
  • cp local/lib/python/ .
  • Change the first line of to #!/usr/bin/env sage
  • Run emacs and type M-x pdb + <ENTER>
  • Use Run pdb (like this): ./ to debug


  • should contain a statement like from sage.all import *, in order to use Sage library code.
  • The code in should not require the Sage preparser. You'll need to use R = PolynomialRing(QQ, 'a,b,c'), for example, instead of R.<a,b,c> = QQ[].

I hope there's a better way! But with this approach, stepping into R = PolynomialRing(QQ, 'a,b,c') will make Emacs jump to the appropriate line of