Open and Navigate JupyterLab#
This guide provides step-by-step instructions for opening and navigating JupyterLab on both macOS and Windows, and how to efficiently navigate the file and directory system within JupyterLab, create and organize files, upload documents, and access important features like the terminal.
Additionally, the guide covers how to save your work effectively, including the use of JupyterLab’s autosave feature and manual checkpoints, ensuring that your progress is always secure.
For macOS users#
Step 1: Open JupyterLab#
Using the Terminal#
Open Terminal You can find Terminal by using Spotlight Search (press
Cmd + Space
and type “Terminal”) or by navigating to Applications → Utilities → Terminal.If you want to start JupyterLab in a specific directory, use the
cd
command to navigate there. For example:
cd path/to/your/project
If you are unsure of the path, you can drag the folder directly into the Terminal window, and it will automatically input the correct path.
Using Finder(Alternative Method)
Navigate to the folder where you want to start JupyterLab.
Open Terminal from Finder:
Right-click on the folder while holding the
Control
key (or use a two-finger tap on a trackpad) and select “New Terminal at Folder”.
If you do not see this option, you might need to enable the “New Terminal at Folder” service. To do this:
Go to → System Settings… → Keyboard → Keyboard Shortcuts… → Services.
Check the box next to “New Terminal at Folder” under the “Files and Folders” section.
Starting JupyterLab:#
In Terminal, type the following command and press Enter
:
jupyter lab
JupyterLab will open in your default web browser. If it does not, copy the URL provided in the Terminal and paste it into your browser.
Step 2: Navigate the File/Directory System#
File Browser:
On the left sidebar of JupyterLab, you will see the File Browser. This shows the directory contents of the folder where JupyterLab was started.
You can open folders by clicking on them. Files (e.g., notebooks, Python scripts) can be opened by clicking on them.
Create new files and folders:
To create a new file or folder, right-click anywhere in the File Browser and select “New Folder” or “New File”. You can also click the
+
icon at the top of the File Browser.
Upload files:
You can drag and drop files from your Finder directly into the File Browser in JupyterLab.
Navigate between folders:
Use the arrows next to folders to expand and collapse them.
You can also use the breadcrumbs at the top of the File Browser to navigate back to parent directories.
For Windows users#
Step 1: Open JupyterLab#
Using Command Prompt:#
Open Command Prompt You can find it by searching “cmd” in the Start menu.
Navigate to your project directory (Optional) Use the
cd
command to navigate to your desired directory. For example:
cd C:\path\to\your\project
Using File Explorer(Alternative Method)
Navigate to the folder where you want to start JupyterLab. Open Command Prompt from File Explorer:
Right-click on the folder while holding the
Shift
key and select “Open command window here” or “Open PowerShell window here”. This depends on your Windows version.On newer versions of Windows 10 and 11, this option might be replaced with “Open in Terminal”.
Starting JupyterLab:#
In the Command Prompt, PowerShell, or Terminal window that opens, type the following command and press Enter
:
jupyter lab
JupyterLab will open in your default web browser. If it does not, copy the URL provided in the command prompt and paste it into your browser.
Step 2: Navigate the File/Directory System#
File Browser:
On the left sidebar of JupyterLab, you will see the File Browser. This displays the contents of the directory where JupyterLab was started.
Click on folders to open them and view their contents. Click on files (e.g., notebooks, Python scripts) to open them in JupyterLab.
Create new files and folders:
Right-click in the File Browser to create a new file or folder. Alternatively, click the
+
icon at the top of the File Browser.
Upload files:
Drag and drop files from File Explorer directly into the JupyterLab File Browser.
Navigate between folders:
Use the arrows next to folders to expand and collapse them.
The breadcrumbs at the top of the File Browser allow you to navigate back to parent directories.
Common tips: Opening, renaming, and closing notebooks#
Opening files: Double-click on any file in the File Browser to open it. Jupyter Notebooks will open in a new tab, and text files, Python scripts, and other file types will open in their respective editors.
Renaming files and folders: Right-click on a file or folder in the File Browser and select “Rename” to change its name.
Saving and reverting notebooks:
Manual save: You can manually save your notebook at any time by clicking the save icon in the toolbar or by pressing
Ctrl + S
(Windows) orCmd + S
(macOS). (This will automatically create a Checkpoint. See “Creating Checkpoints” and “Reverting to Checkpoints” further down.)Autosave: Jupyter Notebooks come with an autosave feature that saves your work automatically at regular intervals. By default, this happens every 120 seconds (2 minutes). You can adjust the autosave interval by modifying the notebook settings if needed.
Check autosave: To see when the notebook was last saved, you can check the File Browser in JupyterLab. The last modified time is displayed next to the notebook’s name, indicating how long ago the last save occurred. This reflects the most recent autosave or manual save.
Create checkpoint: In JupyterLab, a single checkpoint is automatically created each time you manually save the notebook. You can manually save your notebook by clicking the save icon in the toolbar, by pressing
Ctrl + S
(Windows) orCmd + S
(macOS), or by selecting “Save Notebook” from the File menu.Revert notebook to checkpoint: If you need to revert to the last manually saved state of your notebook, you can do so by selecting “Revert Notebook to Checkpoint” in the File menu. This allows you to go back to the state of the notebook at the last manual save, effectively undoing changes made by any subsequent autosaves. However, JupyterLab only maintains the most recent checkpoint, so you cannot revert to multiple earlier states.
Terminal in JupyterLab: You can open a Terminal within JupyterLab by clicking on the terminal icon in the Launcher (the tab with the
+
icon). This can be useful for running additional commands directly from within JupyterLab.Shutting down JupyterLab: To stop the JupyterLab server, go back to your Terminal, Command Prompt, or PowerShell window where JupyterLab was started, and press
Ctrl + C
. Confirm the shutdown if prompted.