Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How do I type path so sage/ubuntu finds my file?

This is a newbie, very basic question. I have installed sagemath on a windows computer using ubuntu. I want to load a file but I don't know where sage/ubuntu is looking for that file. So I get an error (below). How do I type the path so my file is found? Or maybe I can just save the somewhere different that makes things easy?

sage: load('C:\Documents\SAGE\example.sage') <input>:1: DeprecationWarning: invalid escape sequence '\D' <>:1: DeprecationWarning: invalid escape sequence '\D' <ipython-input-20-514939547c9b>:1: DeprecationWarning: invalid escape sequence '\D'

load('C:\Documents\SAGE\example.sage')

OSError Traceback (most recent call last) <ipython-input-20-514939547c9b> in <module> ----> 1 load('C:\Documents\SAGE\example.sage')

/usr/lib/python3/dist-packages/sage/misc/persist.pyx in sage.misc.persist.load (build/cythonized/sage/misc/persist.c:2647)() 171 172 if sage.repl.load.is_loadable_filename(filename): --> 173 sage.repl.load.load(filename, globals()) 174 return 175

/usr/lib/python3/dist-packages/sage/repl/load.py in load(filename, globals, attach) 242 break 243 else: --> 244 raise IOError('did not find file %r to load or attach' % filename) 245 246 ext = os.path.splitext(fpath)[1].lower()

OSError: did not find file 'C:\Documents\SAGE\example.sage' to load or attach

How do I type path so sage/ubuntu finds my file?

This is a newbie, very basic question. I have installed sagemath on a windows computer using ubuntu. I want to load a file but I don't know where sage/ubuntu is looking for that file. So I get an error (below). How do I type the path so my file is found? Or maybe I can just save the somewhere different that makes things easy?

sage: load('C:\Documents\SAGE\example.sage')
<input>:1: DeprecationWarning: invalid escape sequence '\D'
<>:1: DeprecationWarning: invalid escape sequence '\D'
<ipython-input-20-514939547c9b>:1: DeprecationWarning: invalid escape sequence '\D'

load('C:\Documents\SAGE\example.sage')

'\D' load('C:\Documents\SAGE\example.sage') --------------------------------------------------------------------------- OSError Traceback (most recent call last) <ipython-input-20-514939547c9b> in <module> ----> 1 load('C:\Documents\SAGE\example.sage')

load('C:\Documents\SAGE\example.sage') /usr/lib/python3/dist-packages/sage/misc/persist.pyx in sage.misc.persist.load (build/cythonized/sage/misc/persist.c:2647)() 171 172 if sage.repl.load.is_loadable_filename(filename): --> 173 sage.repl.load.load(filename, globals()) 174 return 175

175 /usr/lib/python3/dist-packages/sage/repl/load.py in load(filename, globals, attach) 242 break 243 else: --> 244 raise IOError('did not find file %r to load or attach' % filename) 245 246 ext = os.path.splitext(fpath)[1].lower()

os.path.splitext(fpath)[1].lower() OSError: did not find file 'C:\Documents\SAGE\example.sage' 'C:\\Documents\\SAGE\\example.sage' to load or attach

attach