HomeCourseModule 02 › Install VS Code — your code editor

Install VS Code — your code editor

Module 02 · Setting Up Your Environment8 min readBeginner

What you'll learn

  • Install Visual Studio Code
  • Add the Python extension
  • Open and run a first .py file

Why an editor on top of Anaconda?

Jupyter notebooks (which Anaconda gave you) are great for analysis. But when you start writing reusable scripts — the kind you run on a schedule — you'll want a proper code editor. VS Code is free, from Microsoft, and works the same way on Mac, Windows, and Linux.

Download VS Code

Go to code.visualstudio.com and click the big blue download button. Run the installer with default settings.

On Windows, when asked, tick the boxes for "Add 'Open with Code' action to Windows Explorer file context menu" and "Register Code as an editor for supported file types". Those make life easier later.

Open VS Code for the first time

Launch it. You'll see a welcome screen. The little icons on the far left are your activity bar — files, search, source control, and a "puzzle piece" for Extensions.

Install the Python extension

Click the puzzle-piece icon (Extensions). In the search box, type Python. Install the one made by Microsoft (it has millions of downloads).

That extension is what makes VS Code understand Python: syntax colours, error highlighting, "run this file" buttons, debugging.

Point VS Code at the Anaconda Python

Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows) to open the Command Palette. Type Python: Select Interpreter and pick the option that says "Anaconda" or has anaconda3 in the path.

This tells VS Code: "When I press Run, use the Python that came with Anaconda."

Make your first script

In VS Code, go to File → New File. Save it as hello.py on your Desktop. Paste in:

print("Hello from VS Code!")
for i in range(5):
    print(f"  Line {i + 1}")

Click the green ▶ "Run" arrow in the top right (or press F5 and pick "Python File"). The output appears in the panel at the bottom.

💡 The two-window workflow
Many pros keep VS Code open for scripts and Jupyter open for exploration. You'll naturally fall into the same rhythm.

Key takeaways

  • VS Code is the editor we use for .py scripts.
  • The Microsoft Python extension turns it into a real Python IDE.
  • Always confirm the interpreter — it must point at Anaconda's Python.

Two-minute exercise

Save a new file called about_me.py. Inside, write three lines that print your name, your job role, and what you hope to automate with Python. Run it. Notice how the output appears at the bottom of VS Code, instantly.

📹 Video walkthrough
A video walkthrough of this lesson will be embedded here. Until then, the written walkthrough above mirrors what the video will cover step-for-step.