January 1, 2026 · All About CS
The Complete Guide to Setting Up Your Python Development Environment
Everything you need to go from zero to writing Python — install Python 3 on Linux or Windows, set up VS Code or Sublime Text as your editor, configure essential extensions, and run your first script.
The Complete Guide to Setting Up Your Python Development Environment
Before you write your first line of Python, you need two things: the Python interpreter and a comfortable editor. Getting this right from the start saves hours of frustration later. This guide walks you through every step — installing Python on both Linux and Windows, then setting up two editor options (VS Code and Sublime Text) so you can pick whichever fits your style.
Installing Python
On Linux
Most Linux distributions ship with Python pre-installed. Open a terminal and check:
python --version
# or, if that points to Python 2:
python3 --versionIf the output shows Python 2.x, or Python 3 isn't installed, install it:
sudo apt-get update
sudo apt-get install python3.8Verify the installation:
python3 --version
# Expected: Python 3.8.xPython 2 vs Python 3 on Linux: Many Linux systems still default python to Python 2. Throughout this course, always use python3 and pip3 explicitly until you've configured Python 3 as your system default. This one habit prevents a surprising number of compatibility errors.
| Intent | Python 2 default system | Python 3 default system |
|---|---|---|
| Run a script | python3 script.py | python script.py |
| Install a package | pip3 install pkg | pip install pkg |
| Check version | python3 --version | python --version |
On Windows
Windows does not bundle Python. Download the official installer:
- Go to python.org/downloads and click Download Python 3.x.x.
- Run the
.exefile. - Critical step: Check the box "Add Python to PATH" before clicking Install Now.
Don't skip "Add to PATH." Without it, your terminal won't find the python command and you'll need to reinstall. This is the single most common stumbling block for new Windows users.
After installation, open Command Prompt (Win + R → cmd) and verify:
python --version
# Expected: Python 3.x.x
pip --version
# Expected: pip xx.x from C:\Users\...\Python3x\...Editor Option 1: Visual Studio Code (Recommended)
VS Code is a free, open-source editor from Microsoft with mature Python tooling — making it the go-to choice for both beginners and professionals.
Installing VS Code
On Linux:
# Option A — Snap Store (recommended)
sudo snap install --classic code
# Option B — .deb package
sudo dpkg -i code_*.deb
sudo apt-get install -fOn Windows: Download from code.visualstudio.com, run the installer, and accept the defaults.
Configuring VS Code for Python
Step 1: Install the Python Extension
Create a new file with a .py extension (e.g., hello_world.py). VS Code will prompt you to install the Python extension. If not:
- Open Extensions (
Ctrl+Shift+X). - Search
Python. - Install the one published by Microsoft.
This unlocks:
- IntelliSense — smart autocompletion
- Linting — real-time error checking
- Integrated debugging — breakpoints and variable inspection
- Environment switching — seamlessly switch between Python versions
Step 2: Select Your Interpreter
Look at the bottom-left corner of VS Code. Click the Python version shown to open a picker where you can choose from any Python installation or virtual environment on your machine.
Why does interpreter selection matter? If you later create virtual environments for different projects, this picker lets you switch between them instantly — without touching a terminal.
Step 3: Write and Run "Hello, World!"
print("Hello, World!")Click the ▶ Run button at the top-right. The integrated terminal prints Hello, World!. Alternatively, run from the terminal:
python3 hello_world.py # Linux
python hello_world.py # WindowsThe AREPL Extension (Optional)
AREPL evaluates your Python code as you type, showing output in a live preview panel. Install it from Extensions (Ctrl+Shift+X → search AREPL).
numbers = [1, 2, 3, 4, 5]
squared = [n ** 2 for n in numbers]
print(squared)
# AREPL shows: [1, 4, 9, 16, 25] — instantly, no save/run neededActivate it by clicking the orange AREPL button in the top-right corner of any .py file.
Editor Option 2: Sublime Text
Sublime Text is a lighter-weight editor — fast, distraction-free, and ideal for beginners who prefer simplicity.
Installing Sublime Text
Download from sublimetext.com for your OS. Linux users can also install via Snap Store:
sudo snap install sublime-text --classicConfiguring a Python Build System
Sublime Text can run Python directly. Navigate to Tools → Build System → New Build System and paste:
{
"cmd": ["python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}Save as Python3.sublime-build. Now select Tools → Build System → Python3 and press Ctrl+B to run any .py file.
Installing Package Control and Extensions
Open the Command Palette (Ctrl+Shift+P), type Install Package Control, and install it. Then you can search for extensions:
| Package | Purpose |
|---|---|
| SublimeREPL | Run interactive Python sessions — essential for input() |
| Anaconda (Sublime package) | Linting, autocompletion, and code navigation |
| Kite | AI-powered code completions (optional) |
To install: Command Palette → Package Control: Install Package → search and select.
Running Files with SublimeREPL
For scripts that use input(), the default build system won't work. Use SublimeREPL instead:
Tools → SublimeREPL → Python → Python - Run current file
This opens an interactive pane where you can type input and see output.
The Terminal: Your Universal Fallback
Regardless of editor, you can always run Python from the terminal:
cd ~/projects
python3 hello.pyThis works everywhere and is essential for running scripts with command-line arguments, Django servers, or automated builds.
Quick Verification Script
Run this in your editor of choice to confirm everything works:
import sys
print(f"Python version: {sys.version}")
print(f"Installation path: {sys.executable}")
print("Your environment is ready — happy coding!")Your Environment at a Glance
| Tool | Purpose |
|---|---|
| Python 3.8+ | The interpreter that runs your code |
| VS Code (recommended) | Feature-rich editor with debugging, IntelliSense, Git |
| Sublime Text (alternative) | Lightweight, fast, minimal distraction |
| Python Extension (VS Code) | IntelliSense, linting, debugging, env switching |
| AREPL (VS Code, optional) | Real-time output as you type |
| SublimeREPL (Sublime) | Interactive Python sessions |
What's Next?
Your environment is ready. In the next tutorial, we'll write our first meaningful Python programs — exploring variables, data types, and basic operators. The setup work you've done here means you can follow along hands-on from the very first line.
Happy coding. 🐍