Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to navigate to a different directory in Jupyter Notebook?

I have recently installed Anaconda 5 and with it Jupyter Notebook. I am excited with its rich functionality but I can not find a way to navigate to directories which are not children. More specifically I have tried to double-click the folder icon but that resulted in the same View.

enter image description here

Your advice will be appreciated.

like image 225
rf7 Avatar asked Oct 15 '17 13:10

rf7


2 Answers

Default root of the Jupyter explorer is the current location (folder) where you start the Jupyter server. With the explorer, you can only navigate to all levels of the children folders, but not the parent's of that location. There is an option to set the root folder --notebook-dir when you start Jupyter. Here is an example that starts Jupyter server and sets the root at D:/my_works/jupyter_ipynbs

jupyter notebook --notebook-dir D:/my_works/jupyter_ipynbs

Similarly, for jupyter lab:

jupyter lab --notebook-dir D:/my_works/jupyter_ipynbs

Once Jupyter is open on the browser, its home or root directory will be what you specified as the value of --notebook-dir, in this case D:/my_works/jupyter_ipynbs. From that point, you can navigate to all its sub-directories.

like image 174
swatchai Avatar answered Nov 09 '22 10:11

swatchai


For windows user there is another solution. You can create a symbolic link at directory that Jupyter starts working.

from command prompt: ( mklink /D [the name of the link] [target directory]

mklink /D G_Drive G:\DsN20

like image 6
r.burak Avatar answered Nov 09 '22 11:11

r.burak