Ask Your Question
1

loaded file not found

asked 2019-04-14 14:16:06 +0100

MathF13 gravatar image

updated 2019-04-15 14:31:45 +0100

Iguananaut gravatar image

I am trying to load a python script into sage notebook, with commands load('file.py'), and attach('file.py').

But I am getting the error: IOError: did not find file

The file is there! I am using sage 8.6 on Windows 10.

sage: load('C:\\Program Files (x86)\\MyJournal\\Images\\functions.py')

UPDATE Sage loads the file from my home directory.

I seems that Sage just does not have access to Program Files directory.

---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-104-057b25088154> in <module>()
----> 1 load('C:\\Program Files (x86)\\MyJournal\\Images\\functions.py')

/opt/sagemath-8.6/local/lib/python2.7/site-packages/sage/misc/persist.pyx in sage.misc.persist.load (build/cythonized/sage/misc/persist.c:2470)()
    134 
    135     if sage.repl.load.is_loadable_filename(filename):
--> 136         sage.repl.load.load(filename, globals())
    137         return
    138 

/opt/sagemath-8.6/local/lib/python2.7/site-packages/sage/repl/load.py in load(filename, globals, attach)
    233             break
    234     else:
--> 235         raise IOError('did not find file %r to load or attach' % filename)
    236 
    237     ext = os.path.splitext(fpath)[1].lower()

IOError: did not find file 'C:\\Program Files (x86)\\MyJournal\\Images\\functions.py' to load or attach
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-04-15 10:29:24 +0100

slelievre gravatar image

This is a feature of Jupyter: if DIR is the directory from which the Jupyter server was launched, then Jupyter can only access files inside DIR and its subdirectories.

edit flag offensive delete link more

Comments

1

I will add, as a general principle of Windows usage, please do not store personal files under C:\Program Files.

Iguananaut gravatar imageIguananaut ( 2019-04-15 14:32:46 +0100 )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

1 follower

Stats

Asked: 2019-04-14 14:16:06 +0100

Seen: 1,952 times

Last updated: Apr 15 '19