Error Loading file in sage

asked 2016-10-04 11:28:46 -0500

sansboarders gravatar image

updated 2016-12-03 09:11:49 -0500

kcrisman gravatar image

I am trying to use Sage on a mac and am not particularly computer savvy (e.g. I still haven't figured out what I am meant to do with PATH and find the installation documentation a bit forbidding). I am running sage from the command line from a particular folder which contains a file "test.sage" but when I put 'load("test.sage")' I get the following error message:

TypeError                                 Traceback (most recent call last)
<ipython-input-2-d772665a10d5> in <module>()
----> 1 load("test.sage")

/Applications/SageMath/src/sage/structure/sage_object.pyx in sage.structure.sage_object.load (/Applications/SageMath/src/build/cythonized/sage/structure/sage_object.c:11186)()

    991     if sage.repl.load.is_loadable_filename(filename):
    992         sage.repl.load.load(filename, globals())
    993         return

/Applications/SageMath/local/lib/python2.7/site-packages/sage/repl/load.pyc in load(filename, globals, attach)

    288             if attach:
    289                 add_attached_file(fpath)
    290             exec(preparse_file(open(fpath).read()) + "\n", globals)
    291     elif ext == '.spyx' or ext == '.pyx':
    292         if attach:

TypeError: expected string without null bytes"

Earlier on I was trying the same thing and getting the message:
"IOError('did not find file %r to load or attach'"

I wonder if someone could tell me what I am doing wrong or might try to fix the problem?

edit retag flag offensive close merge delete


kcrisman gravatar imagekcrisman ( 2016-10-04 11:42:50 -0500 )edit

@sansboarders -- How did you install Sage?

slelievre gravatar imageslelievre ( 2016-12-03 07:53:47 -0500 )edit