How to Use Jupyter Notebook inside VS Code

Jupyter notebooks are not just for data scientists and machine learning engineers. Even as a backend developer, you could test out your algorithms interactively inside a Jupyter notebook. It’s helpful when you want to take a TDD-like approach but still need your ideas to somewhat materialize first.

1. Setup Python in VS Code

In a freshly installed version of VS Code, you still need to setup Python. If you’re unsure how to do it, here’s a guide that I wrote.

2. Select an Interpreter

Press Ctrl + Shift + P, search for “interpreter”, and click on “Select Interpreter.” This is how it worked out for me:

Choose the “Select Interpreter” Command
Then Pick on of the Interpreters

You could be prompted by VS Code to install the ipykernel. Say yes. Make sure that the environment that you select has pip or conda already:

Install ipykernel If Not Already Present

3. Create a New Python Notebook

Press Ctrl + Shift + P yet again, but this time search for “jupyter” and select “Create New Blank Jupyter Notebook.”

Click on “Create New Blank Jupyter Notebook”

This should open up the Jupyter notebook as follows:

New Jupyter Notebook

Make sure that you see an interpreter selected on the top right side (in my case, knowledgerepo is a conda environment that I created).

4. Opening Existing Notebooks

Clicking on them within the project should open them up right in the editor.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Site Footer

Sliding Sidebar