How-To Guide
How to Install Python
A step-by-step guide to getting Python running on Windows, Mac, or Linux โ including the one checkbox most beginners miss.
๐ What You'll Need
- A computer running Windows 10/11, macOS 11+, or Linux
- An internet connection
- About 50 MB of free disk space
- 5โ8 minutes of your time
โ Python is completely free and open source. No signup, no license fee, no trial period.
๐ Which Version Should You Install?
Always install the latest stable Python 3 release (Python 3.12 or newer as of 2026).
- Python 3.x โ this is what you want. Actively maintained, all modern libraries support it.
- Python 2.x โ โ do NOT install. It reached end-of-life in 2020 and is no longer supported.
๐ก Why 3.12+? Newer versions have faster performance, better error messages, and the latest standard library features.
Download the Installer
Go to the official website:
๐ python.org/downloads
;The site detects your OS and shows a big yellow Download Python button. Click it.
Direct download links (in case auto-detection fails):
- Windows: "Windows installer (64-bit)" โ the .exe file
- Mac: "macOS 64-bit universal2 installer" โ works on Intel and Apple Silicon
- Linux: use your package manager (see Step 2 below)
Run the Installer
Windows:
- Open the downloaded
.exefile - Click "Yes" when asked for permission
- โ ๏ธ Check "Add python.exe to PATH" at the bottom of the installer window
- Click "Install Now"
- Wait for the installation to complete
- Click "Close"
โ ๏ธ The #1 mistake: Skipping the "Add Python to PATH" checkbox. If you miss it, python won't work from the command line, and you'll need to reinstall or fix it manually.
Mac:
- Open the downloaded
.pkgfile - Click "Continue" through the installer screens
- Accept the license
- Click "Install"
- Enter your Mac password when prompted
- The installer automatically sets up the PATH for you
Linux (Ubuntu/Debian):
Python 3 is usually pre-installed. To check, run:
python3 --version
If it's missing, install it with:
sudo apt update
sudo apt install python3 python3-pip
For Fedora/RHEL:
sudo dnf install python3 python3-pip
Verify the Installation
Open a fresh terminal window:
- Windows: press
Win + R, typecmd, hit Enter - Mac: press
Cmd + Space, type "Terminal", hit Enter - Linux: press
Ctrl + Alt + T
Run this command:
python --version
You should see something like:
Python 3.12.1
On Mac or Linux, you may need to use python3 instead:
python3 --version
๐ก If you see an error like "python is not recognized", jump to the "Common Errors" section below.
Check That pip is Working
Pip is Python's package manager โ you'll use it to install libraries. Verify it's installed:
pip --version
You should see something like:
pip 24.0 from C:\Python312\Lib\site-packages\pip (python 3.12)
On Mac/Linux, use pip3 if pip doesn't work:
pip3 --version
If pip is missing, install it with:
python -m ensurepip --upgrade
Run Your First Python Script
Create a new file called hello.py in any folder.
Open it in a text editor (Notepad, TextEdit, or VS Code) and paste:
print("Hello, World!")
Save the file. Then in your terminal, navigate to the folder where you saved it and run:
python hello.py
You should see:
Hello, World!
๐ Python is now installed and working!
๐งช Recommended: Use a Virtual Environment
A virtual environment keeps your project's packages isolated from your system Python. This is a best practice from the start.
Create a virtual environment inside your project folder:
# Create it
python -m venv venv
# Activate it
# Windows:
venv\Scripts\activate
# Mac/Linux:
source venv/bin/activate
# Install packages into it
pip install requests
# Deactivate when done
deactivate
๐ก Why bother? Without a virtual environment, installing packages globally can break other projects. Every serious Python project uses one.
๐ป Recommended: Install VS Code Next
Python is installed โ but writing code in Notepad isn't fun. Visual Studio Code is the most popular free code editor and has excellent Python support.
๐ How to Install VS Code โ๐ง Common Errors (and Fixes)
โ 'python' is not recognized as an internal or external command
Python isn't on your system PATH. Fixes:
- On Windows: reinstall Python and check "Add Python to PATH"
- Or, use
python3instead ofpython - Or, use the full path to Python (e.g.,
C:\Python312\python.exe)
โ 'pip' is not recognized
Use Python's module invocation instead:
python -m pip install pytube
โ Python 2 vs Python 3 confusion (Mac/Linux)
On older systems, python might point to Python 2. Always check:
python --version
python3 --version
Use python3 and pip3 consistently if this happens.
โ Permission denied during install (Mac/Linux)
Don't use sudo pip install โ it can break system Python. Use:
pip install --user package_name
Or, better, use a virtual environment (see above).
โ Multiple Python versions installed
Check which Python you're using:
where python # Windows
which python # Mac/Linux
The first line of output is the one that runs when you type python.
๐ฏ What's Next?
Python is installed. Time to actually learn it.