How to change the Jupyter start-up folder
Jupyter Notebook and JupyterLab < 3.0
For old Jupyter Notebook interface installed with notebook
package and run as jupyter notebook
(see the next section for the identical interface installed with nbclassic
and run with jupyter nbclassic
, and for JupyterLab):
Open
cmd
(or Anaconda Prompt) and runjupyter notebook --generate-config
.This writes a file to
C:\Users\username\.jupyter\jupyter_notebook_config.py
.Browse to the file location and open it in an Editor
Search for the following line in the file:
#c.NotebookApp.notebook_dir = ''
Replace by
c.NotebookApp.notebook_dir = '/the/path/to/home/folder/'
Make sure you use forward slashes in your path and use /home/user/ instead of ~/ for your home directory, backslashes could be used if placed in double quotes even if folder name contains spaces as such :
"D:\yourUserName\Any Folder\More Folders\"
Remove the
#
at the beginning of the line to allow the line to execute
JupyterLab >= 3, Jupyter Notebook Classic, and RetroLab
For recent nbclassic
and JupyterLab >= 3 use c.ServerApp.root_dir
instead of c.NotebookApp.notebook_dir
(and jupyter server --generate-config
instead of jupyter notebook --generate-config
).
For context see migration guide and this question on differences between server
and notebook
.
I am on Windows 10 but same version of Anaconda.
- Click on the Start Menu, then All Programs (just Programs for Win10)
- Click on the Anaconda3 folder; mine is Anaconda3 (64-bit)
- In there you should see Jupyter Notebook. If you have a virtual environment installed, it will be followed by the environment name like this: Jupyter Notebook (env)
- Right-click Jupyter Notebook entry and navigate to More => Open File Location
- Right-click the correct Jupyter Notebook entry, then click on Properties
- Enter a path in the Start in: box; if the path has spaces in it, you must enclose it in double quotes
- Delete "%USERPROFILE%" at the end of the executable path
cd
into the directory or a parent directory (with the intended directory you will work nested in it).
Note it must be a folder (E:\>
--- This will not work)
Then just run the command jupyter notebook