Gone desperate, searched the issues but found nothing... so I opened this issue.
I want to reset the starting directory for Jupyter Notebook, I googled that by doing:
in C:\Users\username.jupyter\jupyter_notebook_config.py
Change line #c.NotebookApp.notebook_dir = ''
to c.NotebookApp.notebook_dir = 'your path'.
However, I have tried using r'my path', "my path", or simply escape the '\' in the path string, nothing happened, Jupyter still starts at the user's home directory.
Any ideas?
What path are you trying to set it to? Can you show the exact line from your config file? Have you uncommented it?
I have tried as follows:
(1)
c.NotebookApp.notebook_dir = r'E:\Projects\JupyterNotebook'
(2)
c.NotebookApp.notebook_dir = 'E:\Projects\JupyterNotebook'
(3)
c.NotebookApp.notebook_dir = 'E:\Projects\JupyterNotebook\'
(4)
c.NotebookApp.notebook_dir = "E:\Projects\JupyterNotebook"
I have uncommented it, these 4 lines are above are just complete lines I put in that file.
All above didn't work.
As far as I can tell you're doing the right thing. It works on my system. Maybe there's an issue with Windows paths. Can you try with forward slashes / instead of backslashes? I know backslashes are correct on Windows, but Python lets you use forward slashes, and it might behave differently.
Also, do you have the latest version of the notebook package? If not, try updating it.
Changing backslashes to forward slashes didn't work.
The thing I didn't mention is that I used Anaconda3 on my windows, and it includes IPython and Jupyter Notebook.
I tried using 'conda update jupyter' but it says it's already compatible.
Below is a screenshot:
Try conda update notebook traitlets jupyter_core.
Doesn't work.
It shows:
Okay I think I got something.
It's the shortcut provided by the Anaconda that is mal-functioning.
Jupyter notebook works as intented(start in the right working directory) when fired up using cmd, but it defaults to your home directory when using that shortcut.
I guess the Anaconda shortcut is overriding the config. We don't control that shortcut, so you'll need to ask Anaconda about it: https://github.com/ContinuumIO/anaconda-issues/
@zeka0 I found that you have to add two slashes in Windows for it to work.
c.NotebookApp.notebook_dir = 'E:\\Projects\\JupyterNotebook'
I have found solution for this issue :
Step-1 : Open Jupyter Notebook shortcut location from start Menu
Step-2 : Go to properties of that shortcut
Step-3 : In the Target Section, replace "USERPROFILE" with "Jupyter"
Now Jupyter Notebook using that shortcut will also open in the intended location.
(Location as given in the file jupyter_notebook_config.py)
I have found solution for this issue :
Step-1 : Open Jupyter Notebook shortcut location from start Menu
Step-2 : Go to properties of that shortcut
Step-3 : In the Target Section, replace "USERPROFILE" with "Jupyter"Now Jupyter Notebook using that shortcut will also open in the intended location.
(Location as given in the file jupyter_notebook_config.py)
Jupyter will crash on my computer if I replace "USERPROFILE" with "Jupyter".
But if you just delete %USERPROFILE%, Jupyter will work fine.


Consolidating above steps suggested on what worked for me using Windows 10 :
Update Anaconda settings:
Update the Anaconda icon:
Hope that helps.
Most helpful comment
Consolidating above steps suggested on what worked for me using Windows 10 :
Update Anaconda settings:
You can stop here, if you don't use any shortcut icons.
Update the Anaconda icon:
Hope that helps.