How to change the Jupyter Notebook default directory

Problem:

My Jupyter notebooks are not stored on my C drive but the Jupyter UI does not let you select a new drive.

Solution 1:

Start a terminal, navigate to the desired location and enter the following command:

jupyter notebook
Solution 2:

Generate a configuration file then uncomment and set the c.NotebookApp.notebook_dir value to the desired location.

To generate the configuration file use the Anaconda prompt and run the following command:

jupyter notebook --generate-config

This will generate a configuration file that can be used to set the default directory.

Open the file in an editor and locate the line for c.NotebookApp.notebook_dir and uncomment the line.

Set the value to the location you want Jupyter to use.

Restart Jupyter and it should default to your new location.

Note:

If you use Solution 2 you will lose the ability to have the jupyter notebook command from a command prompt open in the current folder.

Add comment

Loading