Ask Your Question

Sage Notebook is not working

asked 2016-01-24 19:39:23 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

I just installed Sage for the first time. I downloaded the app version 7.0 for apple os x version 10.11.4.

When I open the application for the first time, it launches the notebook in chrome Version 48.0.2564.82 beta (64-bit).

I just entered 2+2 and this was the error that I got.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "", line 10, in <module>
    exec compile(u'open("","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Misy"),globals())+"\\n"); execfile(os.path.abspath(""))
  File "", line 1, in <module>

  File "/private/var/folders/kq/pdkzk0sd28vf__cjjm_bqlxh0000gn/T/tmp8hlaTE/", line 2, in <module>
    _sage_const_2 = Integer(2)
NameError: name 'Integer' is not defined
edit retag flag offensive close merge delete


This is bad; I've asked about what could have caused this at!top... There shouldn't have been any change that caused sage.all not to be imported, which is what your error indicates happened (that it's running pure Python). What does the little drop-down menu of languages in the notebook say at start - sage, python, or something else?

kcrisman gravatar imagekcrisman ( 2016-01-26 11:25:06 -0500 )edit

Yes, sage from as well as sage from the sage-7.0-osx-10.11.2-x86_64.dmg do not import "sage.all". They return an import error on even though the library exists. I have built sage from the sage-7.0.tar.gz sources, and this sage 7.0 does work under Mac OS X 10.11.2-10.11.3, but you have to be patient because the build takes several hours. Also, another workaround would be to load the sage app from This sage app works properly under 10.11.2-10.11.4.

nick gravatar imagenick ( 2016-01-26 17:09:24 -0500 )edit

A way for all here to test this is to try running Sage in the terminal and see what happens. It would be good to find out if this is a notebook problem or instead the problem of using a Sage built on a newer machine on an older processor.

kcrisman gravatar imagekcrisman ( 2016-01-26 18:43:56 -0500 )edit

The sage I ran from sage-7.0-ox-10.11.2-x86_64.dmg I ran from the terminal. It still failed. But if I build sage from the sources, and then run it from the terminal, it works including the notebook(). I'm running on Haswell core i7 processors, nearly the most recent ones available (unless you have a Skylake processor).

nick gravatar imagenick ( 2016-01-26 19:02:39 -0500 )edit

There may be other problems with sage 7.0, as I'm having problems running some old Monte Carlo codes that work under sage 6.10 (just checked them again), but that never finish under sage 7.0. They appear to "hang" with no errors returned. Not only that, but simple arithmetic and conditionals that execute upon first attempt will "hang" when attempting to re-execute them, even after interrupting and restarting the worksheet.

nick gravatar imagenick ( 2016-01-27 09:55:37 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2016-01-26 06:44:22 -0500

mnr gravatar image

I get the same error (I tried 1 + 1). It seems that everything is undefined, also objects like Matrix. If you type somewhere Integer = int. Then sage will get 1+1 and output 2, but then if you try to make an object like a Matrix, it will still say that Matrix is not defined.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools


Asked: 2016-01-24 19:39:23 -0500

Seen: 784 times

Last updated: Jan 24 '16