Python Programming Setup Guide for 2026
So you want to learn Python. Great choice — Python's been the fastest-growing major programming language for years, and 2026 is no different. Whether you're aiming for web development, data science, automation, or AI, Python's the place to start.
But before you write your first print("Hello, World!"), you need to set up your environment. That's what this guide is for.
I'll cover every major operating system: Windows, Linux (Ubuntu/Debian), and macOS. And I'll show you two editor paths — one for beginners who want to keep things simple, and one for people who want professional-grade tools from day one.
Which Python Should You Install?
Start here: Python 2 is dead. It's been dead since January 1, 2020. If someone tells you to install Python 2, they're living in the past.
For 2026, you want Python 3.12 or 3.13. These are the current stable releases as of this writing. Python 3.x has been the standard for years, and all major libraries support it.
If you're on a newer Linux distro, you might already have Python 3.12+. On Windows and macOS, you'll install it fresh.
Option A: Simple Setup (Great for Beginners)
If you just want to write Python code without fiddling with configurations, here's the simplest path.
Step 1: Install Python
Windows: Go to python.org/downloads and download the latest Python 3 installer. Run it, and check the box that says "Add Python to PATH" — this is the most common mistake beginners make.
Open a Command Prompt and verify:
python --version
You should see something like Python 3.13.0.
Linux (Ubuntu/Debian): Python is likely already installed. Check:
python3 --version
If it's not installed or you want a newer version:
sudo apt update
sudo apt install python3 python3-pip python3-venv -y
Modern Ubuntu (22.04+) ships with Python 3.10+. Ubuntu 24.04 ships with Python 3.12. You're good.
macOS: macOS ships with Python 3 (as of recent versions), but it's often an older version Apple pins for system tools. Install your own via the official installer:
# Using Homebrew (recommended)
brew install [email protected]
# Or download from python.org
Step 2: Install VS Code
Microsoft's Visual Studio Code is the editor I recommend for everyone starting out. It's free, runs on every platform, and has the best Python support of any editor.
Download from code.visualstudio.com.
After installing, open VS Code and install the Python extension by Microsoft (it's the top-rated one). This gives you:
- Syntax highlighting
- IntelliSense (autocomplete)
- Code formatting
- Debugging support
- Run buttons in the top right of Python files
Step 3: Write Your First Program
Create a new file called hello.py in VS Code:
print("Hello, Python world!")
print("This is my first program!")
# Let's do some math
for i in range(5):
print(f"Counting: {i}")
Click the Run button (▶) in the top right, or press Ctrl+F5 (Windows/Linux) / Cmd+F5 (macOS). You should see your output in the terminal panel at the bottom.
Congratulations — you're programming in Python.
Option B: Professional Setup (pyenv + venv + VS Code)
If you're planning to take Python seriously (building real projects, deploying code, working with different versions), this is the setup you want. It's what I use daily.
What We're Building
- pyenv — Install and switch between multiple Python versions
- venv — Isolate project dependencies so they don't conflict
- pipx — Install Python applications in isolated environments
- VS Code — As above, but with some pro tips
Step 1: Install pyenv
pyenv lets you have Python 3.10, 3.11, 3.12, and 3.13 all on the same machine and switch between them per-project.
Linux / macOS:
curl https://pyenv.run | bash
Add to your ~/.bashrc or ~/.zshrc:
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
Restart your shell, then install a Python version:
pyenv install 3.12.3
pyenv install 3.13.0
Windows: Use pyenv-win:
# In PowerShell as Administrator
Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1"
Step 2: Use Virtual Environments (venv)
Never install project dependencies globally. It's the fastest way to break your system. Always use a virtual environment.
Creating one is built into Python 3:
# Create a project folder
mkdir my-project
cd my-project
# Create a virtual environment
python3 -m venv venv
# Activate it
# Linux/macOS:
source venv/bin/activate
# Windows:
venv\Scripts\activate
When the virtual environment is active, you'll see (venv) in your terminal prompt. Any packages you install with pip will only affect this project.
Step 3: VS Code Professional Settings
When you open a project folder in VS Code, it automatically detects virtual environments if they're in the project root. VS Code will ask "Would you like to select this as the workspace Python interpreter?" — say yes.
A few settings I recommend for every Python developer:
- Format on Save — Settings → Search "Format on Save" → Enable
- Default Formatter — Select "Black" or "Ruff" (install via pip)
- Linting — Enable Pylint or Ruff for real-time error checking
- Type Checking — Install Pylance (comes with the Python extension) and enable
typeCheckingMode: basic
For Linux Users: The Lean Setup
If you're on Linux and prefer simpler tools, Geany is still a solid choice. It's lightweight and just works.
sudo apt install geany
Open Geany, write your hello.py, and press F5 to run. Output shows in a terminal window below the editor.
To configure Geany for Python 3 (if it defaults to Python 2):
- Go to Build → Set Build Commands
- Under "Compile":
python3 -m py_compile "%f" - Under "Execute":
python3 "%f"
Geany won't give you IntelliSense or debugging, but for quick scripts and learning the basics, it's perfectly adequate.
Common Setup Problems (and Fixes)
"'python' is not recognized" on Windows
You didn't check "Add Python to PATH" during installation. Re-run the installer or manually add Python to your PATH environment variable.
"pip: command not found" on Linux
sudo apt install python3-pip
VS Code says "No Python interpreter selected"
Press Ctrl+Shift+P, type "Python: Select Interpreter", and point it to your Python installation.
Permission errors when installing packages
You're installing packages globally without a virtual environment. Create and activate a venv first, then pip install.
What's Next?
Once you're set up, your learning path should look something like this:
- Python basics — Variables, loops, functions, data types
- File I/O and error handling — Reading/writing files, try/except
- External packages —
pip install requeststo fetch data from APIs - Your first project — A weather checker, a to-do list, a web scraper
I've got tutorials on all of these. Start with the basics, build something small, and expand from there. The hardest part is getting started — and now you're ready.
Happy coding!