0

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.

MattB
  • 2,203
  • 5
  • 26
  • 48
  • did you check [this question](http://stackoverflow.com/questions/7169845/using-python-how-can-i-access-a-shared-folder-on-windows-network)? – loopbackbee Aug 05 '15 at 15:53
  • @goncalopp I hadn't, and I just did, but it didn't pan out. In fact, it looks like it absolutely hates the UNC flavor path. It wouldn't even start. – MattB Aug 05 '15 at 16:42

1 Answers1

1

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 (i.e. ipython can't write any data to that location). There are instructions on how to change them here.

  • Ok this sort of got me going in the right direction. I don't have write access on my local PC outside of my user directory, which is where the checkpoints were defaulting to. I had to find this line in the profile: `c.FileNotebookManager.checkpoint_dir` and set it as well. It was still trying to write to some local directory rather than the network path I specified. Thanks for pointing that out. – MattB Aug 05 '15 at 16:48