Setup Jupyter notebook default folder in Anaconda

I had to perform a clean install of my computer and struggled to get Jupyter properly configured. The default folder is located on C:\, but all my files are in my cloud folder on another hard drive.

There is no way to easily change the default folder from Anaconda, so here’s how to proceed :

First, launch the command prompt from Anaconda by clicking on “Open Terminal” (from any environment)

 

The enter the following command : jupyter notebook –generate-config, and wait a few seconds :

This will create a file named “jupyter_notebook_config.py” in your user folder. Open this file and search for “#c.NotebookApp.notebook_dir = ‘

Do not forget to remove the # symbol to uncomment and insert the path to your notebooks folder, using forward slashes, e.g. D:/MyFiles/Notebooks/Python

Restart Anaconda and you’re done !

16 thoughts on “Setup Jupyter notebook default folder in Anaconda”

  1. what about Ubuntu 18.4? it looks that it already comes with jupyter set in another path, and thus it doesn let me import libraries from anaconda…
    sys.path
    [”,
    ‘/usr/lib/python36.zip’,
    ‘/usr/lib/python3.6’,
    ‘/usr/lib/python3.6/lib-dynload’,
    ‘/usr/local/lib/python3.6/dist-packages’,
    ‘/usr/lib/python3/dist-packages’,
    ‘/usr/lib/python3/dist-packages/IPython/extensions’,
    ‘/home/javier/.ipython’]

    Thx!

  2. Doesn’t appear to work.
    I got the file jupyter_notebook_config.py created in my c:\users\\.jupyter folder and did the change. but there is no difference when I load jupyter.

  3. Please note that for windows at least, you MUST have a u infront of the directory. so for example the result should looks like:
    c.NotebookApp.notebook_dir = u’C:/temp/Somewhere/Notebooks/’

  4. I am having the same problem.
    I am using the linux subsystem installed Windows on 10 and installed Anaconda3-2018.12-Linux-x86_64 from my desktop, since then the jupyter lab only starts from the desktop.
    I did
    jupyter notebook –generate-config
    and changed “c.NotebookApp.notebook_dir” to the dir I want, but the Jupyter lab always starts from the desktop.

  5. Thank you. Worked perfectly on Windows 10 without using the u’ before the drive name. Used double bar (\\) for each folder division.

  6. Works fine on windows 10 with below changes

    – additional hypen(- sign) before generate
    jupyter notebook -–generate-config

    -folder path needs double \\

  7. Doesn’t work for me:
    tried:
    c:\users\username\.jupyter –generate-config
    c:users\username\jupyter\jupyter notebook generate — config
    Got the same message:
    c:users\username\jupyter\jupyter is not recognized as an internal or external or external command, operable program or batch file.

  8. Worked well with double hyphen before generate (as the instructions said), being sure the u’ preceded the path, AND changing the backslashes (\) in the path to forward slashes (/).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.