Changing Jupyter Notebook start up folder by modif

2019-07-18 22:15发布

I used to be able to change the default start up folder for Jupyter (the folder Jupyter displays in browser when it was first started) by modifying the "start in" option of the Notebook launch icon's properties on Windows, as described here and here.

However, this is not working any more after I recently installed Anaconda 3. Even though I changed the "start in" folder to the folder I wish, the browser still goes to "Documents" folder by default. I tried doing this as admin, still didn't work. Any suggestions? Thanks!

2条回答
倾城 Initia
2楼-- · 2019-07-18 22:38

The only thing that worked for me to permanently fix the default working directory is by using this comment by MrFancypants.

In your default directory (documents), there is a hidden folder /.jupyter and within it a config python file.

you can edit it and change the line

## The directory to use for notebooks and kernels.
#c.NotebookApp.notebook_dir = ''

to

## The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = 'ENTER_PATH_HERE'

where you should put your favorite path instead of 'ENTER_PATH_HERE.

查看更多
时光不老,我们不散
3楼-- · 2019-07-18 22:53

Although a permanent fix is still not found, I do have the following workaround that works great!

Using the way described here, change the start up dir for Anaconda prompt, then launch it and make sure the default folder is the one you want, and type "jupyter notebook". There! The notebook should launch in your desired folder.

UPDATE: You can also directly launch Anaconda Prompt, then use cd C:\Users\Name\Folder to navigate into the folder where your iPython notebook files are located, and then use jupyter notebook or jupyter notebook myfile.ipynb to start working!

查看更多
登录 后发表回答