Step-by-Step: Install VS Code for Python

✅ Step 1: Download VS Code

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

  2. Click the “Download for Windows”, “macOS”, or “Linux” button (depending on your OS).

  3. Save the installer and run it.


✅ Step 2: Install VS Code

  1. Run the installer you just downloaded.

  2. During installation:

    • ✅ Check: “Add to PATH”

    • ✅ Check: “Add ‘Open with Code’ to context menu”

  3. Click Next and then Install.

  4. When done, launch VS Code.


✅ Step 3: Install Python Extension in VS Code

  1. Open VS Code.

  2. Click on the Extensions icon on the left sidebar (or press Ctrl+Shift+X).

  3. In the search bar, type:
    👉 Python

  4. Click the one by Microsoft (has over 80M+ downloads).

  5. Click Install.


✅ Step 4: Select Python Interpreter

  1. Press Ctrl+Shift+P (or Cmd+Shift+P on Mac).

  2. Type:
    👉 Python: Select Interpreter

  3. Choose the Python version you installed earlier (e.g., Python 3.X.X).

⚠️ If it doesn’t show up, make sure Python is installed and added to PATH. You can also restart VS Code.


✅ Step 5: Write Your First Python File

  1. Click File > New File.

  2. Save the file as:
    hello.py

  3. Type this code:

    python
    print("Hello from VS Code!")
  4. Right-click anywhere in the file and choose “Run Python File in Terminal”.

🎉 You should see the output in the terminal at the bottom!


✅ (Optional) Step 6: Install Pylint (For Error Checking)

VS Code may ask: “Do you want to install pylint?”
Click Yes — this helps catch typos and errors while coding.

🚀 That’s it! You’re now ready to start coding Python in VS Code like a pro!

Leave a Comment