โ˜… Step 1 Getting Started
๐ŸŽ‰
๐Ÿ Getting Started

Python Setup โ€” Zero to Ready

By the end of this guide you'll have Python fully installed, configured, and ready to code โ€” on any operating system.

๐Ÿ

Python Interpreter

The program that reads and runs your .py files. Without it, your code can't execute.

๐Ÿ“ฆ

pip โ€” Package Manager

Installs 500,000+ libraries from PyPI: NumPy, Pandas, Flask, PyTorch โ€” one command each.

๐Ÿ

Virtual Environments

Isolated sandboxes per project so packages never conflict. Essential for professional work.

๐Ÿ› 

IDE / Editor

VS Code, PyCharm, Jupyter โ€” pick the right tool for your workflow.

โš ๏ธ
Always install Python 3.xPython 2 hit end-of-life in 2020. This guide uses Python 3.12 โ€” the latest stable release.

Select your operating system for personalised instructions throughout:

๐ŸชŸ
Windows
10 or 11
๐ŸŽ
macOS
Monterey or later
๐Ÿง
Linux
Ubuntu / Debian / Fedora
โฌ‡๏ธ Step 1

Download Python

Get the installer from the official source. Always use python.org โ€” never unofficial mirrors.

โœ…
Latest Stable VersionPython 3.12.x โ€” released October 2023. 3.12.x
1
Open python.org in your browser
Go to https://www.python.org/downloads/ โ€” the site auto-detects Windows and shows the right button.
2
Click "Download Python 3.12.x"
The large button downloads the Windows 64-bit installer (.exe). For 32-bit systems, scroll down to "Files" and pick the x86 installer.
โ„น๏ธ
Not sure? Go to Settings โ†’ System โ†’ About. "System type" shows 64-bit or 32-bit. Almost certainly 64-bit on modern machines.
3
Wait for download (~25 MB)
File name: python-3.12.x-amd64.exe. Find it in your Downloads folder.
โš ๏ธ
Don't use the system PythonmacOS ships with Python 2.7 or 3.x for internal OS use. Always install your own Python separately.
A
Option A โ€” Homebrew (Recommended)
Install Homebrew first if needed, then Python:
$/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
$brew install python
B
Option B โ€” Official .pkg Installer
Go to python.org/downloads, download the macOS .pkg file, and double-click to install. Requires manual PATH config afterwards.
โ„น๏ธ
Most Linux distros already have Python 3. Check first: python3 --version
$sudo apt update && sudo apt install python3 python3-pip python3-venv -y
$sudo dnf install python3 python3-pip -y
$sudo pacman -S python python-pip
๐Ÿ’พ Step 2

Installation

Run the installer with the right settings. One checkbox makes the difference between success and hours of frustration.

๐Ÿšจ
CRITICAL: Check "Add Python to PATH" before clicking InstallThis single checkbox is the most-missed step. Without it, Python won't work from the command line at all.
๐ŸชŸ Python 3.12.0 (64-bit) Setup
Install Python 3.12.0 (64-bit)
Install launcher for all users (recommended)
โ˜‘ Add Python.exe to PATH CHECK THIS!
1
Double-click the downloaded .exe
python-3.12.x-amd64.exe โ€” click "Yes" on the UAC prompt.
2
โœ… CHECK "Add Python to PATH" FIRST
At the bottom of the first screen. If you miss this, Python won't be accessible from Command Prompt or PowerShell.
3
Click "Install Now"
Default installation is fine for most users. Takes ~1โ€“2 minutes.
4
Click "Close" when done
If prompted to "Disable path length limit" โ€” click it. Removes a Windows restriction on long file paths.
1
Using Homebrew? Already done!
brew install python handled everything. Skip to Step 3 (Verify).
2
Using .pkg installer
Double-click python-3.12.x-macos.pkg, follow the wizard, accept the license.
3
Install SSL certificates (important!)
$/Applications/Python\ 3.12/Install\ Certificates.command
โœ…
Already done!The package manager command from Step 1 installed Python and pip automatically. Head straight to Verify.
โœ… Step 3

Verify Your Installation

Open a terminal and run these commands. If they all return output, you're good to go.

๐Ÿ’ก
Open Command Prompt or PowerShellPress Win + R โ†’ type cmd โ†’ Enter. Or search "PowerShell" in the Start menu.
๐Ÿ’ก
Open TerminalPress Cmd + Space โ†’ type "Terminal" โ†’ Enter.
๐Ÿ’ก
Open TerminalPress Ctrl + Alt + T or find Terminal in your applications.

Click a command to see expected output:

Terminal โ€” Interactive Demo
python --version
Expected output after successful install
$ python --version
Python 3.12.4 โ† you should see this (3.x.x)
$ pip --version
pip 24.0 from /usr/local/lib/python3.12/...
$ python -c "print('Hello, Python!')"
Hello, Python!
โš ๏ธ
macOS / Linux: use python3You may need python3 --version and pip3 instead of python and pip.
๐Ÿšจ
'python' is not recognized?PATH wasn't set during install. Jump to the Troubleshooting section for the fix.
๐Ÿ“ฆ Step 4

pip & Installing Packages

pip is Python's package manager. One command installs any of 500,000+ libraries from PyPI.

Essential pip commands
# Install a package
$ pip install numpy
Successfully installed numpy-1.26.4
# Install specific version
$ pip install numpy==1.25.0
# Install multiple packages at once
$ pip install numpy pandas matplotlib
# Upgrade a package
$ pip install --upgrade numpy
# Upgrade pip itself
$ pip install --upgrade pip
# List installed packages
$ pip list
# Uninstall a package
$ pip uninstall numpy
# Save project dependencies to a file
$ pip freeze > requirements.txt
# Install from requirements file (share with team)
$ pip install -r requirements.txt

๐Ÿ”ฅ Most-Used Packages by Field

๐Ÿ“Š Data Science
numpy โ€” arrays & math pandas โ€” dataframes matplotlib โ€” plotting seaborn โ€” statistical viz scipy โ€” scientific computing
๐Ÿค– AI / ML
scikit-learn โ€” classic ML torch โ€” PyTorch deep learning tensorflow โ€” Google DL transformers โ€” Hugging Face openai โ€” OpenAI API
๐ŸŒ Web Development
flask โ€” lightweight web django โ€” full framework fastapi โ€” modern APIs requests โ€” HTTP client httpx โ€” async HTTP
โš™๏ธ Automation
selenium โ€” browser automation beautifulsoup4 โ€” web scraping pillow โ€” image processing pydantic โ€” data validation rich โ€” beautiful terminal output
๐Ÿ Step 5

Virtual Environments

Isolate packages per project. Prevents version conflicts and is best practice for all Python work.

๐Ÿ
Why you NEED virtual environmentsWithout them, all projects share the same global packages. Project A needs Django 3.2, Project B needs Django 4.2 โ€” they'll break each other. venv solves this with one command.

Complete venv workflow:

Windows โ€” PowerShell or cmd
# 1. Create project folder
> mkdir my-project && cd my-project
# 2. Create virtual environment
> python -m venv venv
# 3. Activate it
> .\venv\Scripts\activate
(venv) C:\my-project> โ† prefix shows venv is active
# 4. Install packages (only this venv)
(venv) > pip install requests numpy pandas
# 5. Freeze dependencies
(venv) > pip freeze > requirements.txt
# 6. Deactivate when done
(venv) > deactivate
macOS โ€” Terminal
# 1. Create project folder
$ mkdir my-project && cd my-project
# 2. Create virtual environment
$ python3 -m venv venv
# 3. Activate it
$ source venv/bin/activate
(venv) my-project $ โ† prefix shows venv is active
# 4. Install packages
(venv) $ pip install requests numpy pandas
# 5. Deactivate when done
(venv) $ deactivate
Linux โ€” Terminal
# 1. Create project folder
$ mkdir my-project && cd my-project
# 2. Create virtual environment
$ python3 -m venv venv
# 3. Activate it
$ source venv/bin/activate
(venv) user@machine:~/my-project$
# 4. Install, freeze, deactivate โ€” same as macOS

venv Alternatives

ToolBest ForKey FeatureInstall
venv Built-inBeginners, general useIncluded with Python 3.3+โ€”
virtualenvMore features than venvFaster, supports old Pythonpip install virtualenv
condaData science, JupyterManages non-Python deps (CUDA, etc.)Install Anaconda/Miniconda
poetryPublishing packagesModern dependency resolverpip install poetry
uvSpeed (100x faster)Rust-based pip+venv replacementpip install uv
๐Ÿ›  Step 6

Choose an IDE / Editor

Pick the right tool to write your Python code. Your editor is where you'll spend most of your time.

๐Ÿ’™
VS Code
Most Popular

Free, fast, extensible. The most popular Python editor. Excellent extensions for linting, debugging, Jupyter, Git.

+ Free ยท Fast ยท Huge extension library ยท Git built-in
โˆ’ Needs extensions to become a full IDE
code.visualstudio.com
๐ŸŸข
PyCharm
Professional

Full Python IDE by JetBrains. Community edition is free. Best-in-class refactoring, debugging, code analysis.

+ Full IDE ยท Smart autocomplete ยท Powerful debugger
โˆ’ Heavier to start ยท Pro version is paid
jetbrains.com/pycharm
๐Ÿ““
Jupyter Lab

Browser-based notebook. Perfect for data exploration, visualization, ML. Run code in cells, see results inline.

+ Interactive ยท Great for data & ML ยท Shareable
โˆ’ Not ideal for large apps
$pip install jupyterlab
โ˜๏ธ
Google Colab

Free cloud Jupyter environment. Zero setup, runs in your browser. Free GPU access for ML. Great for sharing.

+ Zero setup ยท Free GPUs ยท Shareable notebooks
โˆ’ Requires internet ยท Sessions expire
colab.research.google.com

Essential VS Code Extensions for Python

๐Ÿ
Python by Microsoft
Linting, IntelliSense, debugging, formatting. The essential extension.
๐ŸŽจ
Pylance
Supercharged language server โ€” faster autocomplete and type checking.
๐Ÿ““
Jupyter
Run Jupyter notebooks directly inside VS Code.
โšก
Ruff
Ultra-fast Python linter and formatter โ€” replaces flake8 + black in one extension.
๐Ÿ”ง Troubleshooting

Common Errors & Fixes

Click any error to expand the diagnosis and exact fix. These cover 95% of setup issues.

๐Ÿšจ 'python' is not recognized as an internal or external command โ–ผ
Cause: Python is not in your system PATH. The "Add to PATH" checkbox was missed during installation.
Fastest fix: Uninstall and reinstall Python โ€” this time checking the PATH box.
Manual fix (Windows):
1
Search "Environment Variables" in Start โ†’ "Edit system environment variables"
2
Click "Environment Variables" โ†’ find "Path" in System variables โ†’ "Edit"
3
Add C:\Users\YourName\AppData\Local\Programs\Python\Python312\ and ...\Python312\Scripts\
4
Restart Command Prompt/PowerShell and try again.
๐Ÿšจ pip: command not found โ–ผ
Cause: pip not installed or not in PATH. On Linux it's a separate package.
$python -m pip install --upgrade pip
Linux: sudo apt install python3-pip
๐Ÿšจ ModuleNotFoundError: No module named 'xyz' โ–ผ
Cause: Package not installed, or installed in the wrong Python / environment.
$pip install xyz
If still fails, check you're in the right venv: which python (Mac/Linux) or where python (Windows)
๐Ÿšจ PermissionError / Access denied during pip install โ–ผ
Cause: Trying to install globally without admin rights.
Always use a virtual environment!
Or add --user flag:
$pip install xyz --user
๐Ÿšจ SSL: CERTIFICATE_VERIFY_FAILED (macOS) โ–ผ
Cause: macOS .pkg installer doesn't auto-install SSL certificates.
$/Applications/Python\ 3.12/Install\ Certificates.command
๐Ÿšจ venv activation fails on Windows PowerShell โ–ผ
Cause: PowerShell execution policy blocks scripts by default.
Run PowerShell as Administrator:
$Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Or simply use Command Prompt (cmd) instead of PowerShell.
๐Ÿšจ SyntaxError / wrong Python version โ–ผ
Cause: python on your system points to Python 2 instead of Python 3.
Use python3 and pip3 instead. Check with python3 --version.
๐Ÿš€ You're Ready!

What's Next?

Python is installed and configured. Here's your checklist and learning roadmap.

โœ… Final Checklist โ€” verify everything works

โœ“
Python 3.12+ installed โ€” python --version works
โœ“
pip works โ€” pip --version shows output
โœ“
Ran python -c "print('Hello!')" successfully
โœ“
Created and activated a virtual environment with venv
โœ“
Installed a test package: pip install requests
โœ“
Chose and installed an IDE (VS Code or PyCharm)

๐Ÿ—บ Learning Roadmap โ€” What to tackle next

WEEK 1โ€“2
Python Basics
Variables, data types, loops, functions, conditionals, lists, dicts, sets. Resource: docs.python.org or freeCodeCamp Python course.
WEEK 3โ€“4
OOP & Modules
Classes, inheritance, modules, packages, file I/O, exception handling, decorators.
MONTH 2
Pick a Specialisation
Data Science: NumPy โ†’ Pandas โ†’ Matplotlib โ†’ Scikit-learn
Web Dev: Flask or FastAPI โ†’ REST APIs โ†’ Databases
AI/ML: PyTorch โ†’ Neural Networks โ†’ Transformers
MONTH 3+
Build Real Projects
GitHub portfolio โ†’ open source contributions โ†’ projects that solve real problems. Learning by building is irreplaceable.
๐ŸŽ‰
Try your first Python script right now!Open a terminal, type python to enter the REPL, and paste this:
Your first Python program
# Paste this after typing: python
>>> name = input("What's your name? ")
What's your name? Alice
>>> print(f"Hello, {name}! Welcome to Python ๐Ÿ")
Hello, Alice! Welcome to Python ๐Ÿ
>>> print(sum(range(1, 101))) # Sum 1 to 100
5050
๐ŸŽ“

Python is Ready to Go!

You've completed the full setup. Now go build something amazing.