Rasika's Blog: My Personal Knowledgebase
Rasika's Blog: My Personal Knowledgebase
Rasika's Blog: My Personal Knowledgebase
Rasika's Blog
My personal knowledgebase
You can do this either inside the Anaconda navigator or just running the Anaconda Prompt desktop
App.
Go to Environments > Click on the triangular bu on of the target environment (default is:
base(root))
In the terminal window key in the following command to create the “jupyter_notebook_config.py”
config file in the .jupyter folder in default user directory (i.e. C:\Users\<username>)
Open the jupyter_notebook_config.py file in any suitable text editor and modify the
“c.NotebookApp.notebook_dir” entry to point to the desired working directory. You will have to
1 de 3 21/11/2020 13:33
How to change the default working directory of Jupyter and Jupyter La... https://techras.wordpress.com/2019/02/13/how-to-change-the-default-...
modify the “\” to “\\” in your windows file path. Make sure to uncomment the line by removing
the “#”.
1. Hoda says:
May 15, 2020 at 9:26 am
Thank you!
Reply (h ps://techras.wordpress.com/2019/02/13/how-to-change-the-default-working-directory-
of-jupyter-and-jupyter-lab-in-anaconda-navigator-on-windows-environment
/?replytocom=1037#respond)
2. Leif Duncan says:
July 18, 2020 at 8:44 am
This broke my installation
Reply (h ps://techras.wordpress.com/2019/02/13/how-to-change-the-default-working-directory-
of-jupyter-and-jupyter-lab-in-anaconda-navigator-on-windows-environment
/?replytocom=1119#respond)
3. Sean says:
October 14, 2020 at 3:12 pm
Didn’t work for me – I changed the config file as described, but the anaconda shell is still
defaulting to the C:\ directory. What did you mean by “You will have to modify the “\” to “\\”
in your windows file path”? You mean in the working directory I specify after
“c.NotebookApp.notebook_dir = ” “? If so, which \ am I changing to \\? The one right after C:? I
tried that, still didn’t work.
Reply (h ps://techras.wordpress.com/2019/02/13/how-to-change-the-default-working-directory-
of-jupyter-and-jupyter-lab-in-anaconda-navigator-on-windows-environment
/?replytocom=1291#respond)
techras says:
October 15, 2020 at 9:13 am
Hi Sean,
Yes, it’s the c.NotebookApp.notebook_dir path you have to modify to have “\\” instead of
“\”. But this is not needed always, only if you get any errors pointing to the path specified, try
changing the “\”s to “\\”. It’s important to make sure that you delete any spaces in the line
before “c.NotebookApp.notebook_dir” parameter. ex: c.NotebookApp.notebook_dir =
‘C:\\work\\jupyterprjs’ or c.NotebookApp.notebook_dir = ‘C:\work\jupyterprjs’.
2 de 3 21/11/2020 13:33
How to change the default working directory of Jupyter and Jupyter La... https://techras.wordpress.com/2019/02/13/how-to-change-the-default-...
Reply (h ps://techras.wordpress.com/2019/02/13/how-to-change-the-default-working-
directory-of-jupyter-and-jupyter-lab-in-anaconda-navigator-on-windows-environment
/?replytocom=1292#respond)
3 de 3 21/11/2020 13:33