Change the Jupyter Notebook startup folder in Windows and Mac

How to change the Jupyter Notebook startup folder in Windows & Mac ?

This tutorial guides you on how to change the Jupyter Notebook startup folder in Windows 10 & Mac. When you launch Jupyter Notebook you will see a new browser window showing a Notebook Dashboard where you can access only files within the start-up folder including any sub folder. Let’s see how to change Jupyter Notebook startup folder in Windows.

Change the Jupyter Notebook startup folder in Windows 10

There are couple of ways using which you can change the startup folder.

To change jupyter notebook startup folder in Windows using shortcut properties follow the below steps.

1: First, type “jupyter” in the Windows search, then do Right Click -> Open File Location.

2: It would open the file explorer where jupyter.exe exists. You will list of jupyter scripts inside the following folder

C:\Users990\AppData\Local\Programs\Python\Python38-32\Scripts

3: After that you need to create a shortcut for jupyter-notebook.exe by doing Right Click -> Create shortcut. Then you could see a shortcut file created called “jupyter-notebook – Shortcut” as shown in the picture below.

Change the Jupyter Notebook startup folder in Windows and Mac

 

4: Then copy that shortcut to the desktop, do Right Click -> Properties -> Shortcut Tab and change the value for “Start in” to the start-up folder that you would like to change. I have changed the startup folder as C:\Users\91990\Documents\sneppets\Workspaces\Python\Examples as shown below.

Change the Jupyter Notebook startup folder shortcut

 

5: And click Apply -> Ok to save the settings.

6: Finally, Double Click the jupyter-notebook – Shortcut in the desktop window, it will open up the command prompt and run jupyter notebook server with the modified startup folder. You should be able to see the message ” Serving notebooks from local directory: C:\Users\91990\Documents\sneppets\Workspaces\Python\Examples” as shown below. Therefore the startup-folder is changed.

jupyter-notebook - Shortcut

[I 07:57:37.724 NotebookApp] The port 8888 is already in use, trying another port.
[W 07:57:37.750 NotebookApp] Terminals not available (error was No module named 'winpty.cywinpty')
[I 07:57:37.751 NotebookApp] Serving notebooks from local directory: C:\Users990\Documents\sneppets\Workspaces\Python\Examples
[I 07:57:37.751 NotebookApp] Jupyter Notebook 6.3.0 is running at:
[I 07:57:37.751 NotebookApp] http://localhost:8889/?token=74c386dc06cbf1f0ac5285076c5b35903efd09318359e90e
[I 07:57:37.752 NotebookApp]  or http://127.0.0.1:8889/?token=74c386dc06cbf1f0ac5285076c5b35903efd09318359e90e
[I 07:57:37.752 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 07:57:37.797 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///C:/Users/91990/AppData/Roaming/jupyter/runtime/nbserver-13396-open.html
    Or copy and paste one of these URLs:
        http://localhost:8889/?token=74c386dc06cbf1f0ac5285076c5b35903efd09318359e90e
     or http://127.0.0.1:8889/?token=74c386dc06cbf1f0ac5285076c5b35903efd09318359e90e

Also, you would see notebook interface will appear in new browser (default) window or tab and you could access files from your local directory (start-up folder).

Change the Jupyter Notebook startup folder Windows/ Mac OS

There is another way using which you can change the startup folder of Jupyter Notebook i.e., cd command. Let’s see how to do that.

1: Open a new command prompt in Windows or click on spotlight and type terminal to open terminal window in Mac OS

2: Go to the startup folder using cd command.

> cd C:\Users990\Documents\sneppets\Workspaces\Python\Examples

3: Finally type python -m notebook command from the terminal to launch the Jupyter Notebook interface in a new browser window or tab with the preferred startup folder.

C:\Users990\Documents\sneppets\Workspaces\Python\Examples> python -m notebook

[I 12:10:56.381 NotebookApp] Writing notebook server cookie secret to C:\Users990\AppData\Roaming\jupyter\runtime\notebook_cookie_secret
[W 12:10:57.016 NotebookApp] Terminals not available (error was No module named 'winpty.cywinpty')
[I 12:10:57.016 NotebookApp] Serving notebooks from local directory: C:\Users990\Documents\sneppets\Workspaces\Python\Examples
[I 12:10:57.017 NotebookApp] Jupyter Notebook 6.3.0 is running at:
[I 12:10:57.017 NotebookApp] http://localhost:8888/?token=2ad96578b2fddf1825107039bae731e076d7d8620967bfc3
[I 12:10:57.017 NotebookApp]  or http://127.0.0.1:8888/?token=2ad96578b2fddf1825107039bae731e076d7d8620967bfc3
[I 12:10:57.017 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 12:10:57.070 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///C:/Users/91990/AppData/Roaming/jupyter/runtime/nbserver-13252-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=2ad96578b2fddf1825107039bae731e076d7d8620967bfc3
     or http://127.0.0.1:8888/?token=2ad96578b2fddf1825107039bae731e076d7d8620967bfc3

That’s it. You had learnt how to change the Jupyter Notebook startup folder both in Windows and Mac OS.

Hope it helped 🙂

You’ll also like:

References

guest
0 Comments
Inline Feedbacks
View all comments