Ask Your Question

loaded file not found

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

MathF13 gravatar image

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

Iguananaut gravatar image

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

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\\')

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\\')

/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)()
    135     if sage.repl.load.is_loadable_filename(filename):
--> 136         sage.repl.load.load(filename, globals())
    137         return

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

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

1 Answer

Sort by ยป oldest newest most voted

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

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



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 +0200 )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


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

Seen: 1,551 times

Last updated: Apr 15 '19