Skip to content

bobby_dreamer

Jupyter notebook default startup directory in windows

jupyter1 min read

I want everything organized like i have created a folder in 'D' drive to test Python scripts in Jupyter Notebooks. When starting jupyter notebook, it starts up in C:\Users\Sushanth .

I am like "WHAT", there should be a way to change this. There should be a config file or settings somewhere to change this.

This is the point, where i am more worked up in changing this directory than coding some python scripts

I google a bit and find out there are two ways to do this and in my head 3 ways get this done,

# Method 1 ( Dont start to try this just yet )

  1. Open "Anaconda prompt". It should open up in the default directory
  2. Go into folder .juypter
  3. Enter the below command and it will generate a file named jupyter_notebook_config.py
  4. Open the file in Notepad. Find c.NotebookApp.notebook_dir. Its a commented line, so '#' found beginning of the line, delete it and add the path of your folder. Save the file.
  5. Close the Jupyter Notebook and Close the Anaconda Terminal
  6. Open Jupyter Notebook again.
  7. Voila ( Nothing happened, it started in same old C:\Users\Sushanth directory )

# Method 2

  1. Go into the desired folder

  2. Enter the command

  3. Voila ( It works )

# Method 3

You installed Anaconda and started Jupyter Notebook to learn python. Does it matter actually where to you save it. Problem is even before starting Jupyter Notebook, you created a folder structure and decided to save your files there. Expectations. hmm.

Create a new folder in the default directory and start writing some scripts.

Now go play snake charmer, time to tame some snakes.