How to Install Python and Visual Studio Code on Windows – Step-by-Step Guide

Want to start coding in Python from scratch? This complete guide walks you through installing Python and Visual Studio Code on Windows 10 or 11 step by step – clear, fast, and safe. Perfect for beginners taking their first steps in programming with one of the world’s most popular languages.


🖥️ WHAT YOU WILL NEED

  • Operating System: Windows 10/11
  • Internet connection
  • Free space: minimum 1 GB

✅ STEP 1: INSTALL PYTHON ON WINDOWS

Go to the official Python website:

👉 https://www.python.org/downloads/

  1. Click on "Download Python X.X.X" (latest stable version).
  2. Run the installer and check ✅ "Add Python to PATH".
  3. Click "Install Now".
  4. Once done, close the installer.
  5. Open the terminal (CMD or PowerShell) and type:
  6. python --version
    or
    py --version

🧰 STEP 2: INSTALL VISUAL STUDIO CODE

Go to the official website: 👉 https://code.visualstudio.com/

  • Download the Windows version
  • During installation, check:
    • ✅ Add to PATH
    • ✅ Register as default editor
    • ✅ Add "Open with Code" to context menu

🔌 STEP 3: INSTALL THE PYTHON EXTENSION IN VS CODE

  1. Open VS Code
  2. Click the Extensions icon (left sidebar)
  3. Search for 👉 Python
  4. Install the official Microsoft extension
  5. Enable: autocomplete, code execution, and virtual environments

🧪 STEP 4: CREATE YOUR FIRST PYTHON SCRIPT

  • Open or create a folder in VS Code
  • Create a file named hello.py
  • Write:
  • print("Hello from VS Code with Python!")
  • Save the file with Ctrl + S

▶️ STEP 5: RUN THE CODE

You have several options to run your code.

OPTION 1: INTEGRATED TERMINAL

  • Go to: Terminal > New Terminal
  • Run:
  • python hello.py

OPTION 2: "▶ Run" BUTTON

  • Click the "Run Python file" button
  • You’ll see the output in the bottom console

⚙️ STEP 6 (OPTIONAL): CONFIGURE PYTHON ENVIRONMENT

  • Press Ctrl + Shift + P
  • Type: Python: Select Interpreter
  • Select your desired Python version for the project

📦 STEP 7 (OPTIONAL): INSTALL PACKAGES

Use pip from the terminal:

pip install numpy pandas requests

Or create a virtual environment:

python -m venv venv
.\venv\Scripts\activate
pip install flask

🎉 DONE!

You now have Python fully configured in VS Code and are ready to start coding with the full power of this lightweight yet powerful editor.

START NOW WITH PRACTICE EXERCISES

Python Exercises: https://www.juanantonioripoll.es/python-programming-exercises/