Setting Up Jupyter in VS code: A Step-by-Step Guide for Python Learners

Nicole WongNicole Wong
2 min read

Setting Up Jupyter in VS code: A Step-by-Step Guide for Python Learners

Introduction

Jupyter Notebooks have become an essential tool for learning Python. Many tutorials and online courses use Jupyter for it interactivity and clarity when presenting code and output.

But here comes a question:

How Exactly Do You Start Using Jupyter?

There are many answers out there, but as someone who prefers lightweight solutions, I suspected the setup in VS Code would be straightforward -- and it was.

This guide outlines the steps I took to get Jupyter running smoothly inside VS Code. If you run into any issues along the way, feel free to comment and share your experience.


My Configuration Context (for Reference)

Before diving in, here's a quick overview of the environment I used.

  • Python was already installed and configured in my VS Code.
  • My pip was set successfully.

Step 1: Install the Jupyter Extension

Open the Marketplace, search for Jupyter, and install the one developed by Microsoft.


Step 2: Create a New Jupyter Notebook

In your project folder, create a new file with the ipynb extension. This tells VS Code that it is a Jupyter notebook.


Step 3: Install the Required Library ipykernel

To execute code within your notebook, you need the ipykernel. You can install it the way you prefer.

In my case, I ran:

pip install ipykernel

Step 4: Write and Run Your First Notebook

Open your notebook(e.g., Hello.ipynb).

  1. Click + Markdown to add a text cell. Enter the following:

    This is my first Jupyter Notebook!
    
  2. Click + Code to add a code cell. Enter:

    print("Hello World!")
    
  3. Click the triangle run icon to execute the code cell, and you will see the output:

    Hello World!
    

If your code runs correctly, then your Jupyter environment is working.

Additionally, if your notebook contains multiple code cells, you can run all of them using the Run All button in the top toobar.


Step 5: Save the Notebook

Save your notebook file. The .ipynb file is stored in JSON format, which keeps both code and output data.


Summary

This setup process takes only five steps. The complexity largely depends on whether your initial environment is properly configured. Problems with environment variables or package sources can interrput the workflow.

Once configured, using Jupyter in VS Code is efficient and powerful -- ideal for learning, data analysis, or experimentation.

1
Subscribe to my newsletter

Read articles from Nicole Wong directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Nicole Wong
Nicole Wong