4

I'm using the latest version of Jupyter lab on a Windows 10 64 bit machine inside Firefox. When I start the Jupyter lab (via cmd) the default working directory appears to be

c:/windows/system32

(i.e the folder tab on the left) which is a terrible place to be meddling with, at leat for me. I don't know why Jupyter lab starts there. I've installed Jupyter lab using cmd with administrator privileges. Is that why? Should I have it installed just for a user? (My machine has only one user;me). I tried changing the directory by using

jupyter notebook --generate-config

And inserted a path to my documents folder (in the path for kernels and notebooks line) , edited out the commentary ("#"). And when I restarted Jupyter lab nothing has changed. It shows the

c:/Windows/system32

as default directory which has so many windows folders and is too messy to deal with. Any solutions will be greatly appreciated. Thanks in advance:)

6
  • Does this answer your question? How to change the Jupyter start-up folder Commented Oct 23, 2021 at 16:41
  • In particular you seem to be using the notebook instructions whereas you should probably use server as described in the second section (I now improved formatting in that answer to make it more obvious). Commented Oct 23, 2021 at 16:43
  • Unrelated: have you tried to just change the current directory in the command line before starting JupyterLab via cmd? Commented Oct 23, 2021 at 16:44
  • Please provide enough code so others can better understand or reproduce the problem. Commented Oct 23, 2021 at 17:47
  • @krassowski Sorry I was using my phone to write the question, here is the clear details. I used Jupyter lab --generate-config to get the settings file. And this is how it looks now c.ServerApp.root_dir = "C:/Users/name/Documents/Python" But no changes whatsoever. Commented Oct 24, 2021 at 1:07

1 Answer 1

3

A late answer to one of the most common Jupyter Notebook or Jupyter Lab questions most new users have about the file/folder structure when they first begin using Jupyter.

For those Windows users who may still be using that old school Windows Command Prompt - which is actually being phased out of Windows, the Windows Command Prompt will normally start-up and display the location where the Windows Command Prompt application is located on the Windows PC:

c:/Windows/system32

In a nutshell, the OP opened the Windows Command prompt, and then the OP typed the following code to start Jupyter Notebook:

Jupyter notebook

But when the OP created / saved the new Notebook file, it was saved to the Windows / system 32 folder - definitely not a location where anyone wants to save their files.

To avoid saving Jupyter Notebook files in the wrong place, the Command Prompt must be started in a different folder or be moved to another directory. One way to move the Command Prompt is by using an old dos command, Change Directory. Just type cd for Change Directory.

Best advice, create a new folder on the C drive and call it Jupyter_Files. Then use old dos, Change Director command, navigate from the location where the command prompt opens and move to that new folder. Do the following to navigate to the new folder.

cd..
cd..
cd Jupyter_Files

Now the Command Prompt is in the location where the Notebook files want to be saved. At the Command Prompt, type: Jupyter notebook. This will create and save those notebook files in this new folder.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. It helped me to figure out what was happening. By the way, I tried multiple times to have anything that could be easier than " anaconda terminal > jupyter lab ". However, every time I face a problem with shortcuts and other stuff, do you have any recommendations to start Jupyter Lab in an easier way without having to open the heavy Anaconda environment with a lot of options that I never use?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.