In our previous blog, we covered how to install Python on Windows. Now that Python is ready, the next step is to prepare a reliable editor to write, run, and manage Python programs efficiently.
Among all editors, Visual Studio Code (VS Code) stands out. It’s free, lightweight, and highly customizable with extensions, making it one of the most popular choices for Python developers. In this article, we’ll go step by step to install VS Code on Windows, connect it with Python, and add extensions that make coding much easier.
How to Install VS Code on Windows (Step by Step)
- Step 1: Download VS Code
- Open your browser and visit the official website: https://code.visualstudio.com
- Click on “Download for Windows” (User Installer)

- Step 2: Run the Installer
- Double-click the .exe file after it finishes downloading.
- Accept the License Agreement → click Next.
- Keep the default install location → Next.
- On “Select Additional Tasks,” select:
- ✅ Create a desktop icon (optional)
- ✅ Add to PATH (recommended)
- ✅ Register Code as an editor for supported file types
- Click Install to start the process.

- Step 3: Launch VS Code
- 1.After installation, click Finish (Launch Visual Studio Code).
- 2.VS Code will open with a Welcome / Get Started screen.

Setting Up Python in VS Code (Step by Step)
- Step 4: Install Python Extension
- Open VS Code.
- Go to the Extensions tab (left sidebar or press Ctrl + Shift + X).
- Search for “Python” by Microsoft.
- Click Install.
- 👉 This extension lets VS Code detect Python files, highlight syntax, and run code smoothly.
- Step 5: Choose Python Interpreter
- Since Python is already installed on your system (from the previous blog):
- Press Ctrl + Shift + P inside VS Code.
- Type: Python: Select Interpreter.
- Pick the version you installed (example: Python 3.12).
- Step 6: Write and Run Your First Python File
- Create a new file → Save it as test.py.
- Add this code:
- print(“Hello, Python with VS Code!”)
- Right-click inside the editor → select Run Python File in Terminal.
- The terminal will display:
- Hello, Python with VS Code!
- Congratulations! You’ve successfully set up Python with VS Code.
Frequently Asked Questions (FAQs) about VS Code and Python
- Is Visual Studio Code free to use?
Yes! VS Code is completely free and open-source. You can download and use it on Windows, macOS, and Linux without paying anything. - Can I use VS Code for other programming languages?
Absolutely. VS Code supports many languages such as C, C++, Java, JavaScript, HTML, CSS, PHP, and more. You just need to install the right extensions for the language you want to use. - Do I need Python installed before using VS Code for Python?
Yes. VS Code is just an editor—it cannot run Python by itself. You need to install Python separately and then connect it with VS Code (as shown in this blog). - What are the best VS Code extensions for Python beginners?
Some must-have extensions are:
Python (by Microsoft) – helps run Python code.
Pylance – provides smart code suggestions and error checking.
Jupyter – lets you run Jupyter notebooks inside VS Code.
Prettier – formats code neatly.
GitLens – for version control with Git.
- Why should I use VS Code instead of IDLE (the default Python editor)?
IDLE is very basic, while VS Code is a modern editor with features like debugging, code formatting, intelligent suggestions, extensions, and built-in Git support. This makes coding faster and easier. - Can I use VS Code without the internet?
Yes, once installed, you can use VS Code offline to write and run code. However, for downloading extensions and updates, an internet connection is needed. - How do I fix the “Python not found” error in VS Code?
If you see this error, it usually means:
Python is not installed, or
The environment variable is not set correctly, or
You haven’t selected the correct interpreter in VS Code.
You can fix it by installing Python and selecting the right interpreter (Ctrl + Shift + P → Python: Select Interpreter).
Leave a Reply