NameError: name 'Integer' is not defined

asked 2016-11-10 08:25:50 -0500

0x22 gravatar image

updated 2017-08-01 12:15:03 -0500

FrédéricC gravatar image

Hi, all of a sudden, I'm experiencing a strange error and cannot find any solution for it. Sage itself works fine, but as soon as I try to load any .sage file, the application can't start. Inside sage I can do any calculation/operation as usual, but if I for example load an application that contains:

a=1
b=2

sage returns:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-496f9e9073df> in <module>()
----> 1 load("u.sage")

sage/structure/sage_object.pyx in sage.structure.sage_object.load (/build/sagemath/src/sage-7.4/src/src/build/cythonized/sage/structure/sage_object.c:12333)()

/usr/lib/python2.7/site-packages/sage/repl/load.pyc in load(filename, globals, attach)
    245             if attach:
    246                 add_attached_file(fpath)
--> 247             exec(preparse_file(open(fpath).read()) + "\n", globals)
    248     elif ext == '.spyx' or ext == '.pyx':
    249         if attach:

/usr/lib/python2.7/site-packages/sage/structure/sage_object.so in <module>()

NameError: name 'Integer' is not defined

Yesterday everything was working fine. I hadn't done any system upgrades and the error appears on programs written and working yesterday and on new written programs.

Does anyone know how to solve this error or where it suddenly comes from? A restart didn't change anything...

edit retag flag offensive close merge delete

Comments

For some reason sage.all isn't being imported. Can you tell us exactly what you are doing to load? Is this on your personal computer or in the cloud or ... ? Tell us as much detail about your specific situation as you can.

kcrisman gravatar imagekcrisman ( 2016-11-10 09:16:25 -0500 )edit

Similar but due to an incompatibility in processors, maybe: https://ask.sagemath.org/question/323...

kcrisman gravatar imagekcrisman ( 2016-11-10 09:17:45 -0500 )edit
kcrisman gravatar imagekcrisman ( 2016-11-10 09:18:24 -0500 )edit

This is happening when I am in the sage terminal (local, not in the cloud) and I type load("file.sage"). The machine is running arch-linux. I'm not using notebook or anything else. Just the simple sage console. Everything else works fine. When I - instead of loading the file inside sage - type in my bash sage file.sage, sage creates a .py file and works fine too. There seems to be an error retrieving the file inside sage and I don't know why. EDIT: I'm using a AMD A10-5750M APU.

0x22 gravatar image0x22 ( 2016-11-19 08:49:58 -0500 )edit