How to change the working directory in Jupyter in windows 10

Sindhujeendru
1 min readMar 8, 2021

I got a new laptop recently and this time I wanted my home directory for Jupyter notebook to be D drive, instead of C Drive. This is how I came up with this story

  1. Open Anaconda Prompt and run jupyter notebook --generate-config.
  2. This writes a file to C:\Users\username\.jupyter\jupyter_notebook_config.py.
  3. Copy the link displayed in Anaconda prompt and browse to the file location and open it in an Editor
  4. Search for #c.NotebookApp.notebook_dir = ‘’ in the file. And update the required directory where you need your Jupyter to open in quotes.
  5. Use front slashes for the path. If you want to use back slashes, use double quotes. Remove the # at the beginning of the line to allow the line to execute. Save the file
  6. This will just update the home directory.
  7. Then, go to the shortcut of Jupyter Notebook located in C:\Users\User_name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Anaconda3 (64-bit)
  8. Do the right click and go to the Properties. In the Target field, remove %USERPROFILE%
  9. Then, In the field of Start in, type the same directory updated in jupyter_notebook_config.py
  10. Done. You will be able to see the home directory as your desired directory.

--

--