Ask Your Question

newby has trouble with "load" in

asked 2013-05-29 16:06:48 -0500

anonymous user


updated 2015-01-24 14:50:57 -0500

FrédéricC gravatar image

I get a syntax error when trying the command

load "example.sage"

in a workspace in

Error in lines 1-1
Traceback (most recent call last):
  File "/mnt/home/VCQT9SWb/.sagemathcloud/", line 412, in execute
    exec compile(block, '', 'single') in namespace, locals
  File "<string>", line 1
    load "example.sage"
SyntaxError: invalid syntax
edit retag flag offensive close merge delete

4 answers

Sort by » oldest newest most voted

answered 2013-06-02 17:15:16 -0500

William Stein gravatar image

It's best to use load('example.sage'), which is just a normal Python function call, but will do what you want. These "% magics" have got a bit out of hand, at least in cases when they are not needed.

edit flag offensive delete link more

answered 2013-09-18 00:21:04 -0500

Vijay gravatar image


I used load command and in my .SAGE file I have another load for *.pyx file. I am observing following while running .SAGE script:

load('hopf_animate.sage') Compiling ./fib_param.pyx...

It is taking lot of time, so am I missing something here.

Thanks & Regards, Vijay

edit flag offensive delete link more

answered 2013-09-18 00:56:26 -0500

Vijay gravatar image


Problem is resolved. Please ignore my last question.

Thank you Vijay

edit flag offensive delete link more

answered 2013-05-29 20:38:07 -0500

vdelecroix gravatar image


Even with a standard Sage installation, the command load "example.sage" will not work. Use

%runfile example.sage

instead (but I do not know whether it would work on the cloud).

edit flag offensive delete link more


Yes, with standard sage, "load" provokes a message "DeprecationWarning: Use %runfile instead of load", but loads it anyway. But in a "worksheet", "%runfile" doesn't work, either, resulting in "NameError: name 'runfile' is not defined"

Daniel R. Grayson gravatar imageDaniel R. Grayson ( 2013-05-30 01:09:28 -0500 )edit

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: 2013-05-29 16:06:48 -0500

Seen: 1,248 times

Last updated: Sep 18 '13