Run the installer, configure key options, and understand the VS Code interface.
1
Double-click the .exe installer
Accept the license. On the "Select Additional Tasks" screen, check these options:
☑️
Recommended checkboxes to enable:
Add "Open with Code" action to Windows Explorer file context menu
Add "Open with Code" action to Windows Explorer directory context menu
Register Code as an editor for supported file types
Add to PATH (so you can type code . in any terminal)
2
Click "Install" then "Finish"
VS Code launches automatically. Restart your terminal to use the code command.
1
Extract and move to Applications
Unzip the downloaded file, then drag Visual Studio Code.app into your /Applications folder. If you used Homebrew, skip this — already done.
2
Enable the code CLI command
Open VS Code → press Cmd+Shift+P → type "Shell Command" → click "Shell Command: Install 'code' command in PATH".
✅
Already done!The package manager command installed and registered VS Code. The code command is already in your PATH.
💡
Launch with: code . from any project directory, or find VS Code in your applications menu.
VS Code Interface — Know Your Way Around
Visual Studio Code — my-project
📁
🔍
🧩
🌿
🐛
Explorer
📁 my-project
🐍 main.py
📓 notebook.ipynb
📄 requirements.txt
📁 .venv
Search
🔍 Search in files...
Ctrl+Shift+F / Cmd+Shift+F
Extensions
🐍 Python ✓
📓 Jupyter ✓
🎨 Pylance ✓
Ctrl+Shift+X / Cmd+Shift+X
Source Control
🌿 main branch
M main.py
Run & Debug
▶ Run Python File
🐛 Debug Python File
1# main.py — click sidebar icons to explore →
2importnumpyasnp
3
4defgreet(name):
5print(f"Hello, {name}!")
6
7greet("Python")
← Click the sidebar icons above to explore each panel
🐍 Step 3
Install the Python Extension
The official Python extension by Microsoft turns VS Code into a full Python IDE with IntelliSense, debugging, and more.
🐍
Python
Microsoft · 170M+ downloads · ⭐ Verified Publisher
IntelliSense (autocomplete), linting, debugging, code navigation, code formatting, refactoring, variable explorer, and test runner support for Python files.
Press Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (Mac) → search Python → click Install on the Microsoft result.
B
Via Command Palette
Press Ctrl+Shift+P → type ext install ms-python.python → press Enter.
C
Via Terminal (CLI)
$code --install-extension ms-python.python
What the Python extension adds to VS Code:
🧠 IntelliSense
Auto-complete for Python keywords, functions, variables, and imported modules. Hover docs show docstrings inline.
🐛 Debugger
Set breakpoints, step through code, inspect variables — all inside VS Code. No separate debugger needed.
🏝 Virtual Envs
Detects and activates virtual environments automatically. Switch interpreters from the status bar.
✅ Test Runner
Run pytest or unittest tests directly in VS Code. See pass/fail inline next to each test function.
✅
Verify installationOpen any .py file — you should see the Python version in the bottom status bar (e.g., Python 3.12.4). If not, click the status bar to select an interpreter.
📓 Step 4
Install the Jupyter Extension
Run Jupyter notebooks (.ipynb files) directly inside VS Code — no browser, no separate server.
📓
Jupyter
Microsoft · 90M+ downloads · ⭐ Verified Publisher
Edit, run, and debug Jupyter notebooks (.ipynb) inside VS Code. Includes interactive variables explorer, cell execution, and rich output rendering (plots, tables, HTML).
Create a project, link your virtual environment, write code, and run it — all inside VS Code.
1
Open a folder as a project
In Command Prompt:
>mkdir hello-python && cd hello-python && code .
In Terminal:
$mkdir hello-python && cd hello-python && code .
2
Select a Python Interpreter
Press Ctrl+Shift+P (or Cmd+Shift+P) → type Python: Select Interpreter → choose your Python version or virtual environment. You'll see it in the status bar at the bottom.
💡
To use a virtual environment, create it first: python -m venv .venv, then select .venv as your interpreter in VS Code.
3
Create hello.py
Press Ctrl+N (new file), paste this code, save as hello.py:
hello.py
1# Your first Python file in VS Code
2defmain():
3name = input("Enter your name: ")
4print(f"Hello, {name}! VS Code is ready 🚀")
5
6if__name__=="__main__":
7main()
4
Run the file
3 ways to run:
Click the ▶ Run button in the top-right corner
Right-click in editor → "Run Python File in Terminal"
Press Ctrl+F5 (run without debugger) or F5 (run with debugger)
🎉
VS Code is fully set up!You can now write Python with IntelliSense, run Jupyter notebooks, debug, lint, and format — all in one tool.
🔧 Troubleshooting
Common Issues & Fixes
Click any error to expand the diagnosis and solution.
🚨Python extension not showing interpreter / "No Python interpreter selected"▼
Cause: Python extension can't find a Python installation, or you need to manually select one.
Fix: Press Ctrl+Shift+P → Python: Select Interpreter → choose your Python from the list. If empty, ensure Python is installed and in your PATH.
🚨Jupyter: "No kernel found" or "Failed to start kernel"▼
Cause:ipykernel is not installed in the selected Python environment.
$pip install ipykernel --upgrade
Make sure your venv is activated when running this. Then reload VS Code window: Ctrl+Shift+P → "Reload Window".
🚨'code' is not recognized as a command in terminal▼
Cause (Windows): "Add to PATH" was not checked during installation, or terminal hasn't been restarted.
Fix Windows: Reinstall VS Code with PATH option, or add C:\Users\{user}\AppData\Local\Programs\Microsoft VS Code\bin to PATH manually.
Fix macOS: Open VS Code → Cmd+Shift+P → "Shell Command: Install 'code' command in PATH".
🚨IntelliSense / autocomplete not working▼
Causes: Wrong interpreter selected, Pylance not installed, or extension needs restart.
Steps:
Verify correct interpreter selected (status bar, bottom-left)