I just started IPython Notebook, and I tried to use \"Save\" to save my progress. However, instead of saving the *.ipynb in my current working directory, it is saved in my p
To run in Windows, copy this *.bat file to each directory you wish to use and run the ipython notebook by executing the batch file. This assumes you have ipython installed in windows.
set "var=%cd%"
cd var
ipython notebook
Jupyter under the WinPython environment has a batch file in the scripts
folder called:
make_working_directory_be_not_winpython.bat
You need to edit the following line in it:
echo WINPYWORKDIR = %%HOMEDRIVE%%%%HOMEPATH%%\Documents\WinPython%%WINPYVER%%\Notebooks>>"%winpython_ini%"
replacing the Documents\WinPython%%WINPYVER%%\Notebooks
part with your folder address.
Notice that the %%HOMEDRIVE%%%%HOMEPATH%%\
part will identify the root and user folders (i.e. C:\Users\your_name\
) which will allow you to point different WinPython installations on separate computers to the same cloud storage folder (e.g. OneDrive) where you could store, access, and work with the same files from different machines. I find that very useful.
To add to Victor's answer, I was able to change the save directory on Windows using...
c.NotebookApp.notebook_dir = 'C:\\Users\\User\\Folder'
I tried the other solutions, but I didn't find that c.NotebookApp.notebook_dir
setting in the config...
#jupyter_notebook_config.json
{
"NotebookApp": {
"nbserver_extensions": {
"jupyter_nbextensions_configurator": true
}
}
}
So, what I do is:
cd
into the directory where I want the notebooks and checkpoints
savedjupyter-lab
# ipython cell
import os
# change where notebooks are stored
os.chdir('/Users/me/Project')
os.getcwd()
Yes, you can specify the notebooks location in your profile configuration. Since it's not saving them to the directory where you started the notebook, I assume that you have this option set in your profile. You can find out the the path to the profiles directory by using:
$ ipython locate
Either in your default profile or in the profile you use, edit the ipython_notebook_config.py
file and change the lines:
Note: In case you don't have a profile, or the profile folder does not contain the ipython_notebook_config.py
file, use ipython profile create
.
# The directory to use for notebooks.
c.NotebookManager.notebook_dir = u'/path/to/your/notebooks'
and
# The directory to use for notebooks.
c.FileNotebookManager.notebook_dir = u'/path/to/your/notebooks'
Or just comment them out if you want the notebooks saved in the current directory.
Update (April 11th 2014): in IPython 2.0 the property name in the config file changed, so it's now:
c.NotebookApp.notebook_dir = u'/path/to/your/notebooks'