Open Jupyter Notebook from a Drive Other than C Drive

Question:

I have a machine learning project in drive D. It contains python notebook files. But when I launch jupyter notebook through command prompt, it only shows directories inside drive C. How can I navigate to a drive other than C drive without changing jupyter notebook startup path?. I’m using windows 10 operating system. All the solutions I found, trying to change notebook startup path.

Asked By: Thamindu DJ

||

Answers:

You can launch it from any drive/location you want with the --notebook-dir option.

For example:

jupyter notebook --notebook-dir=D:/
Answered By: Leo Brueggeman

To permanently change the default directory of Jupyter do the following:

  • Look for the Shortcut to open Jupyter notebook.
  • Right Click on the Shortcut
  • Go to Properties.
  • Look for ….jupyter-notebook-script.py "%USERPROFILE%/"
  • Change %USERPROFILE%/ to the folder you wish.
  • Restart Jupyter notebook.
Answered By: Vikas Awasthi

Follow these steps:

  1. Open Anaconda Prompt
  2. Insert this command,
    jupyter notebook --notebook-dir=NameOfTheDrive:.

As Example for Drive D, jupyter notebook --notebook-dir=D:

Answered By: Rubel

My repositories are in the drive R.

I am running Jupyter on Windows 10 in the Ubuntu 18.04, so the drive R is at /mnt/r.

$ nano ~/.bashrc  
alias notebook="jupyter notebook --notebook-dir=/mnt/r" 
$ source ~/.bashrc  
$ notebook

It does not open the browser automatically, so I have to copy the URL manually.
It may ask you to enter the token which you can get by executing:

$ jupyter notebook list
Answered By: Uki D. Lucas

Another good option is from your terminal go to the disk you want to start jupyter by example :

cd D:

And then launch jupyter notebook

jupyter notebook
Answered By: OnizukaGTO

Okay, this question seems to have already been addresses, but I’d like to add quick step launch solution for this case. I created a batch file (windows .bat file) with the following script and saved it on my desktop. I just double click it to launch the files in the respective drive.

@echo ON
title Launch Jupyter notebooks from Drive D
jupyter notebook --notebook-dir=D:
@echo OFF

Copy paste this code in a text file and save it as a *.bat file on your Desktop. Just fire it up every time you want to launch Jupyter.

You can create various versions of this file for each drive as required and keep them handy.

Answered By: Aravind Molugu

Open the Anaconda Prompt

type the following:

jupyter notebook --notebook-dir=D:

This is what worked for me in windows.

Answered By: TheArtasse

My solution is to create a batch file which allows me to execute jupyter at the current directory.

  1. Create a batch file jupy.bat with the following content:
   jupyter notebook --notebook-dir=%1
  1. Save the jupy.bat in some folder, let say in d:scripts
  2. Append d:scripts in PATH environment variable. So that i can call jupy just everywhere.
  3. From now on, i can go to the folder where i store my notebooks, and execute the command:
    jupy .
Answered By: anhquan
  1. Open Jupyter notebook as usual

  2. Click on NewTerminal

  3. Type the code below in terminal, where you want to point to F drive

    jupyter notebook --notebook-dir=F:/
    
  4. Jupter notebook new session url will open in your default internet explorer

Answered By: Harish Masand

If you are using JupyterLab, just type in your desired terminal;

jupyter lab --notebook-dir=D:/

It will create a new port to access D: drive in JupyterLab

This is to open Jupiter lab from E Drive

Open Anaconda Prompt
Type the code below in terminal, where you want to point to E drive

jupyter lab --notebook-dir=E:/
Answered By: Dhivakar R

you can directly access by following command:

jupyter notebook --notebook-dir=D:/

Alternate method is go to Anaconda Prompt or Anaconda Termial
then Access D drive and launch the jupyter notebook

D:
jupyter notebook
Answered By: Sadhana Singh

*To change just one time :
user following code in your Anaconda prompt .
jupyter notebook –notebook-dir=E:

*To permanently change the default directory of Jupyter do the following:
Right click on Jupyter notebook icon.
Go to Properties.
In shortcut tab->target you will find something like this -> jupyter-notebook-script.py "%USERPROFILE%/"
Change %USERPROFILE%/ to the folder you want to start from eg : jupyter-notebook-script.py "E:folder_path".
Restart Jupyter notebook.

Answered By: Jahnvi Patel

The most easiest solution in my opinion

  • Open Notepad
  • Paste the command "jupyter notebook –NotebookApp.iopub_data_rate_limit=1.0e10"
  • Save the notepad file with an extension of ".bat" instead of ".txt"
  • Paste the file in which directory you want to initialize your jupyter
  • Double click and open the ".bat" file
  • Jupyter opens with desired directory as base
  • This way you control the jupyter root directory as and when required and don’t
    really have to perform any manual settings

Hope this helps

".bat" file created on Desktop

enter image description here

".bat" file double clicked and executed

enter image description here

jupyter opens with Desktop as the intended base directory

enter image description here

Answered By: Irfan Shaikh

If you are using Anaconda Navigator, do the following steps.

Open command prompt (CMD.exe Prompt)

Type "D:" and press enter.

Now type "Jupyter Notebook" in the next line and press enter.

Wait for few seconds, you will be automatically redirected to Jupyter notebook.

Answered By: Manikandan
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.