How to change the working directory of Jupyter and Jupyter Lab on Windows environment

  1. Open cmd (or 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 and browse to the file location and open it in an Editor

4. Search for the following line in the file: #c.NotebookApp.notebook_dir = ''

5. Replace by c.NotebookApp.notebook_dir = 'C:/the/path/to/home/folder/'

Make sure you use forward slashes in your path , backslashes could be used if placed in double quotes even if folder name contains spaces as such : "D:\yourUserName\Any Folder\More Folders\"

6. Remove the # at the beginning of the line to allow the line to execute. Save the file.

7. Open cmd (or Anaconda Prompt) and run jupyter lab. You will see your home directory being set to the new path.

Voila!

--

--

Python and data geek ✰ Make jewellery at http://orentalks.com/ ✰ https://www.linkedin.com/in/shanyitan/

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store