In this post I’ll discuss how to change the Jupyter notebook startup folder in Anaconda which is installed on a Windows system. I find it easier to work in a startup folder where I keep all my development workspaces. So let’s get going and get this done.
Open the Anaconda Navigator and click on Environments -> base(root) -> Open Terminal
This will open a command prompt window. Type the command jupyter notebook –generate-config in the command window and press Enter. This will create a file with the name jupyter_notebook_config.py in the location C:\Users\YOUR_USERNAME\.jupyter
Go to the folder location C:\Users\YOUR_USERNAME\.jupyter and open the file named, jupyter_notebook_config.py in any text editor.
Everything in this config file will be commented on file creation. Search for the key string, #c.NotebookApp.notebook_dir
Uncomment the key string by deleting the # sign and in single quotes type the location of your custom startup folder and save the changes. Use forward slashes instead of backward slashes in the folder path. As an example, I’ve entered the location C:/jupyter_workspace. To verify that I am seeing the right workspace folder after done with all the changes, I’ve added a blank text file named, welcome_to_jupyter.txt in the folder.
To bring the changes into effect, restart Anaconda Navigator and launch Jupyter notebook. You should now see the startup folder changed to your supplied location.
It works for me. Thank you for sharing this!
You really helped with a nagging problem that I had when working with it
thanks a lot man i really do appreciate your help.
really you saved my mood today.
It worked! Thanks!
thanks!! 🙂
Thanks a lot for this article, it worked for me.
Thank you so much, it works and this help a lot.
Thanks for the suggestion. It worked.
No worries!
Thanks man
thanks. been trying to do this for ages
this works well
No worries! Good to know that it was useful.
Thanks for tip!
God, you are my hero! Thanks for saving my time. Worked just perfectly.
Cheers!
You will have to modify the “\” to “\\” in your windows file path.
You are welcome Brian! I’m glad my efforts are proving useful.
You are welcome!
Many thanks – it worked fine once I corrected my error. I do appreciate the effort you put into this site, for the benefit of others.
Thanks for this. I’m just about to see if it works, now that I’ve got past an early trap for the unwary. You suggest entering jupyter notebook –generate-config at the command prompt and – being a novice – I didn’t realise that that should be: jupyter notebook –generate-config (that is, two hyphens rather than the one I typed).
Really useful. I have been wondering how to do this for a while. Thanks a lot.
Thank you for sharing that!
Ok, at first I thought it wasnt’t working, then I went a bit deeper…
This tutorial does work if Jupyter is launched from within Anaconda Navigator.
If you, like me, use Start Menu shortcut the shortcut, then the shortcut itself needs to be edited.
The destination should be changed from:
C:\Users\d_abb\anaconda3\python.exe C:\Users\d_abb\anaconda3\cwp.py C:\Users\d_abb\anaconda3 C:\Users\d_abb\anaconda3\python.exe C:\Users\d_abb\anaconda3\Scripts\jupyter-notebook-script.py “%USERPROFILE%”
To:
C:\Users\d_abb\anaconda3\python.exe C:\Users\d_abb\anaconda3\cwp.py C:\Users\d_abb\anaconda3 C:\Users\d_abb\anaconda3\python.exe C:\Users\d_abb\anaconda3\Scripts\jupyter-notebook-script.py “C:/Whenever/You/Want/With/Forward/Spaces”
Doesn’t seem to work… Even after the change, Jupyter keeps starting om my default user folder.
Thank you!
Thank you but it doesnt work for my case.
Good explanation
Glad to know that! Thank you for your feedback.
Thank you, Mr. Gaur, for this post. It has been very useful to me at starting on Anaconda environment.