Installing Visual Studio Code(VS Code) for Python 3

By Lenin Mishra

Prerequisite - Installing Python on your machine

Although, you can learn to code in the Python Interactive session on your command line, you should use an Integrated Development Environment(IDE) for writing your Python code.

In this article, you will learn to install Visual Studio Code(VS Code) for Windows 10. However, you can use this process for any operating system.

Step 1 - Download Visual Studio Code

Visit the website of Visual Studio Code. It will automatically show you the right exe file for your operating system. Click on the “Download” button.

VS Code website

Your exe file will be downloaded and you will be redirected to a “Thank you for downloading VS Code” page.

VS Code Download Success

Step 2 - Installing VS Code

Click on the downloaded exe file and it should open up the installer.

Check “I accept the agreement” and click on “Next>”.

VS Code Installer

You can choose to create a Desktop icon and add VS Code to your PATH. Make the choices you want and press “Next>” and then press “Install”.

VS Code Create Desktop Icon

Once the installation finishes, you will see the successful installation page. When you click on “Finish”, VS Code Editor will be launched.

VS Code Successful Installation

Step 3 - Write your first program

Open VS Code and click on “File” and then “Open Folder”. For the purpose of this tutorial, we will create our python files inside a trial folder present in Desktop.

Open New folder in VS Code

In the trial folder, create a new python file called test.py.

Create new Python file in VS Code

Write your first Python code print("Hello World!").

Your first Python program with VS Code

However, you won’t be able to run your code. You need to understand that VS Code works like a simple text editor. It has no built-in support for Python.

To run Python code, you need to download the Python extension for VS Code.

Step 4 - Download Python extension for VS Code

Click on the Extension button on the left hand menu bar.

VS Code Extensions button

The Marketplace for VS Code Extensions should open up. Search for python in the search bar.

Search for Python Extensions on VS Code

Choose the Python extension provided by Microsoft and click on “Install”.

Install Python Extensions for VS Code

Now when you go back to your test.py file, you should be able to see a Run button.

Run Python code on VS Code

Once you click on the Run button, your Python code will be successfully executed.

Python code execution on VS Code

Check out installation guides for other Python IDEs.

  1. Install Pycharm Community Edition for Python 3
  2. Install Python 3 on Windows
  3. What can you do with Python?
  4. Benefits of using Python 3 over 2
  5. Learn to Print in Python 3