%attach/attach() does not work in sage jupyter (sage 7.5.1)
Whenever I open a jupyter notebook in Sage 7.5.1 (sage -n jupyter
), issuing a magic command
%attach myfile.py
or an inline attach
command
attach("muyfile.py")
results in an error:
UsageError: Invalid GUI request 'sage', valid ones are:['osx', 'qt4', 'qt5', 'nbagg', None, 'gtk', 'gtk3', 'notebook', 'tk', 'inline', 'wx', 'qt']
I found this error in sagemath 7.5.1, but it is not present in sagemath 7.2. The magic %load
, however, works.
Any workarounds? (besides changing %attach
to %load
, I mean.)
Upon further searching, I found that in file
/Applications/SageMath-7.5.1.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/repl/inputhook.py
there is a registered input hook:register('sage', sage_inputhook)
. It seems that the 'sage' GUI has no support for attaching files?