How to Set Microsoft Edge as Your Default Browser for Jupyter Lab

Orenaike Oluwatosin
2 min readNov 17, 2023

--

In an effort to optimize my PC’s performance, I recently decided to experiment with Microsoft Edge, particularly for running Jupyter Lab. This arose from a desire to reduce the high CPU usage often associated with Google Chrome, the default browser for Jupyter Lab. Below, I’ll share the steps I took to make Edge the default browser for Jupyter Lab, simplifying the process for those who might be less tech-savvy.

Step-by-Step Guide:

Step1: Access Command Prompt: Start by opening your command prompt. This is a text-based interface that allows you to interact with your computer’s operating system.

Step2: Install Jupyter Lab (if necessary): If you haven’t already installed Jupyter Lab, you can do so by typing the following command into the command prompt:

pip install jupyter

Step 3: Generate the Configuration File: Run the command below to create a configuration file for Jupyter Lab:pip install jupyter

jupyter notebook --generate-config

Note: This file will be created in your user directory. For instance, on my computer, it was located at C:\\Users\\[YourUsername]\\.jupyter\\jupyter_notebook_config.py.

Step 4: Create a Backup of the Config File: Navigate to the file directory (C:\\Users\\[YourUsername]\\.jupyter), right-click on the jupyter_notebook_config.py file, then copy and paste it in the same directory to create a backup.

Step 5: Open the Configuration File: You can use any Integrated Development Environment (IDE) or text editor to open this file. For those unfamiliar, an IDE is a software application that provides comprehensive facilities to computer programmers for software development.

Step 6: Locate and Modify the Browser Setting: In the configuration file, search for the term “.browser”. Here, you will find a field named c.NotebookApp.browser. This is where you can specify the path to the executable file of your preferred browser.

Step 7: Set the Path for Microsoft Edge: Replace the existing path in c.NotebookApp.browser with the path to the Microsoft Edge executable. For example:

c.NotebookApp.browser = 'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe'

Important: Make sure to remove the “#” at the beginning of the line. This process is known as “uncommenting” and is necessary for the change to take effect.

You can now atempt to launch Jupyter Lab or Notebook from cmd using “Jupyter lab”.

By following these steps, you can easily switch your default browser for Jupyter Lab to Microsoft Edge, potentially leading to better performance and lower CPU usage. Remember, while an IDE can be a powerful tool for development, sometimes a simple script can be just as effective for smaller tasks.

--

--