Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Rasika's Blog: My Personal Knowledgebase

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

How to change the default working directory of Jupyter and Jupyter La... https://techras.wordpress.com/2019/02/13/how-to-change-the-default-...

Rasika's Blog

My personal knowledgebase

How to change the default working directory of


Jupyter and Jupyter Lab in Anaconda Navigator
on Windows environment

February 13, 2019 techras Uncategorized


Open up the Anaconda command prompt:

You can do this either inside the Anaconda navigator or just running the Anaconda Prompt desktop
App.

To open the Anaconda command prompt through Anaconda navigator:

Go to Environments > Click on the triangular bu on of the target environment (default is:
base(root))

Then select “Open Terminal” from the popup menu

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>)

Modify the config file and restart Anaconda Navigator:

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 “#”.

Save the file and restart the Anaconda Navigator.

4 thoughts on “How to change the default


working directory of Jupyter and Jupyter Lab
in Anaconda Navigator on
Windows environment”

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’.

Hope this helps

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)

Blog at WordPress.com. (h ps://wordpress.com/?ref=footer_blog)

3 de 3 21/11/2020 13:33

You might also like