Before writing code locally, you need to set up three tools: Python, pip, and VS Code. This takes 10–15 minutes and only needs to be done once.
1. Installing Python
Windows
- Go to python.org/downloads and download the latest stable version (3.10+)
- Run the installer
- Important: Check the Add Python to PATH checkbox on the first screen — without it, Python won’t be accessible from the terminal
- Click Install Now
Verify after installation — open PowerShell and run:
python --version
macOS
Most Macs come with Python 2, but we need Python 3. Check what you have:
python3 --version
If the version is 3.10+ — you’re good to go. If not, install it via Homebrew:
brew install python3
Or download the installer from python.org (choose the macOS installer).
Linux (Ubuntu/Debian)
sudo apt update
sudo apt install python3 python3-pip
2. Verifying pip
pip is Python’s package manager and is installed alongside Python. Check that it’s available:
pip --version
# or
pip3 --version
If pip isn’t found, try:
python -m pip --version
To upgrade pip to the latest version:
python -m pip install --upgrade pip
3. Installing VS Code
VS Code is the most popular editor for Python. It’s free and works on Windows, Mac, and Linux.
- Download from code.visualstudio.com
- Install it like any other application
- On first launch, pick a color theme (any one you like)
4. VS Code Extensions for Python
Open the Extensions panel with Ctrl+Shift+X (Mac: Cmd+Shift+X).
Must-Have
Python (by Microsoft)
- Syntax highlighting, autocompletion, and code execution
- Automatically suggested when you open a .py file
- Install this one first
Pylance (by Microsoft)
- Smart autocompletion and type checking
- Installed automatically alongside the Python extension
Recommended
Python Indent
- Automatically inserts correct indentation after colons (if, def, for)
- Saves a lot of time while writing code
Python Docstring Generator
- Generates a docstring stub when you type """
- Useful for documenting functions
Error Lens
- Shows errors and warnings inline on the affected line, not just in the bottom panel
- Very handy — you see exactly what’s wrong at a glance
5. Configuring VS Code for Python
Selecting the Interpreter
VS Code needs to know which Python to use (especially important when using virtual environments):
- Open the Command Palette: Ctrl+Shift+P (Mac: Cmd+Shift+P)
- Type
Python: Select Interpreter - Choose the desired interpreter from the list
After selecting, the Python version will appear in the status bar at the bottom of the screen.
Auto Save
Enable auto save: File → Auto Save. Files will be saved on every change — you won’t lose your code.
Open Folders, Not Files
Always open your project folder, not individual files:
# In the terminal, from your project directory:
code .
Or use File → Open Folder. This way VS Code sees the full project structure.
6. The Integrated Terminal
VS Code has a built-in terminal — open it with Ctrl+` (backtick, the key below Esc).
The terminal opens automatically in the project folder. It’s convenient: you run code and see your files in the same window.
7. Useful Keyboard Shortcuts
| Action | Windows/Linux | Mac |
|---|---|---|
| Run Python file | F5 | F5 |
| Open terminal | Ctrl+` | Ctrl+` |
| Command Palette | Ctrl+Shift+P | Cmd+Shift+P |
| Search in project | Ctrl+Shift+F | Cmd+Shift+F |
| Format code | Shift+Alt+F | Shift+Option+F |
| Rename symbol | F2 | F2 |
Quick Verification
After installation, open a terminal and run:
python --version # Python 3.x.x
pip --version # pip xx.x.x
code --version # VS Code version
All three commands should respond without errors — your environment is ready.
💬 Comments (0)
No comments yet
Be the first to share your opinion about this article!