简体   繁体   中英

IPython Notebook - saving notebook fails

Saving my IPython notebook fails.

I've set up a folder on a network drive which I'd like to save my notebooks to, but it isn't quite cooperating yet.

In ipython_notebook_config.py I've edited the following lines:

c.NotebookManager.notebook_dir = u'Z:\\Analytics\\Work\\MyFolder'
c.FileNotebookManager.notebook_dir = u'Z:\\Analytics\\Work\\MyFolder'
c.NotebookApp.notebook_dir = u'Z:\\Analytics\\Work\\MyFolder'

but still no joy.

This is IPython 2.1.0

I'm a little new to Python and IPython Notebook, so this may be obvious, not sure.

The following is the traceback:

Traceback (most recent call last):  
File \"C:\\Anaconda\\lib\\site-packages\\IPython\\html\\base\\handlers.py\", line 286, in wrapper    
    result = method(self, *args, **kwargs)  
File \"C:\\Anaconda\\lib\\site-packages\\IPython\\html\\services\\notebooks\\handlers.py\", line 209, in put
    self._save_notebook(model, path, name)  
File \"C:\\Anaconda\\lib\\site-packages\\IPython\\html\\services\\notebooks\\handlers.py\", line 145, in _save_notebook
    model = self.notebook_manager.save_notebook(model, name, path)
File \"C:\\Anaconda\\lib\\site-packages\\IPython\\html\\services\\notebooks\\filenbmanager.py\", line 289, in save_notebook
    self.create_checkpoint(name, path)  
File \"C:\\Anaconda\\lib\\site-packages\\IPython\\html\\services\\notebooks\\filenbmanager.py\", line 433, in create_checkpoint    
    os.mkdir(self.checkpoint_dir)\nWindowsError: [Error 5] Access is denied: u'.ipynb_checkpoints'

EDIT:

Thanks to Simon Smith below I tracked it down.

Checkpoints were still saving to the wrong place. I changed this line in the config:

c.FileNotebookManager.checkpoint_dir = r'Z:\Analytics\Work\MyFolder\.ipynb_checkpoints'

and now I'm sailing along. I've also edited the other paths to be r'such and such' as well. Thanks again.

The final line looks suspicious here:

os.mkdir(self.checkpoint_dir)\\nWindowsError: [Error 5] Access is denied: u'.ipynb_checkpoints'

This looks like a permissions issue on that directory (ie ipython can't write any data to that location). There are instructions on how to change them here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM