Guide: Installing Python 3 on Windows &
macOS
This guide walks you through setting up Python 3 on Windows and macOS and running your
first script using the command line.
Windows (PowerShell)
1. Downloading Python
1) Go to the official [Link] Downloads page.
2) Click the button that says Download Python 3.x.x (the latest stable version).
3) Once the .exe file downloads, open it to start the installer.
2. The Critical Step (Don't Miss This!)
When the installer window opens, you will see a checkbox at the bottom that says:
■ Add [Link] to PATH
Important: You must check this box. Adding Python to your PATH is what allows Windows
PowerShell to recognize the python command from any folder.
Then:
1) Click Install Now.
2) Once finished, click Close.
3. Verifying Installation in PowerShell
Now, let's make sure your computer knows Python is installed.
1) Press the Windows key, type powershell, then hit Enter.
2) In the blue window, type the following command and press Enter:
python --version
If successful, you should see something like Python 3.12.x printed in the window.
Page 1
Windows (PowerShell)
4. Running Your First Script
To run a Python file via PowerShell, follow these steps:
1) Create a file: Open Notepad (or VS Code) and type: print("Hello from the terminal!").
2) Save it: Save the file as [Link] in a folder you can find easily (like your Desktop).
3) Navigate in PowerShell: Use the cd (change directory) command to go to your Desktop:
cd Desktop
Run the file: Type the following and hit Enter:
python [Link]
Troubleshooting Common Issues
"Python is not recognized"
This usually means the Add [Link] to PATH box wasn't checked during installation. Run the
installer again and choose Modify or Repair to add Python to PATH.
Execution Policy Error
If PowerShell refuses to run scripts, you may need to run PowerShell as Administrator and enter:
Set-ExecutionPolicy RemoteSigned
Page 2
macOS (Terminal)
1. Install Python 3
You have two common options. If you're new, the official installer is the simplest.
Option A: Official [Link] installer (recommended for most students)
1) Go to the official [Link] Downloads page.
2) Download Python 3.x.x for macOS and open the .pkg installer.
3) Click through the installer steps and finish the installation.
Option B: Homebrew (common for developers)
1) Open Terminal (Applications -> Utilities -> Terminal).
2) If you already have Homebrew installed, run:
brew install python
2. Verify Installation
In Terminal, run:
python3 --version
You should see something like Python 3.12.x.
3. Run Your First Script
1) Create a file in a folder (for example, Desktop) named [Link] with:
print("Hello from the terminal!")
2) In Terminal, navigate to that folder:
cd ~/Desktop
3) Run the script:
python3 [Link]
Page 3
macOS (Terminal)
Troubleshooting on macOS
"python3: command not found"
If you used the [Link] installer, close and reopen Terminal and try again. If you used Homebrew,
ensure Homebrew is installed and run brew doctor.
Xcode Command Line Tools prompt
Some Macs prompt you to install Command Line Tools the first time you run developer commands. If
prompted, accept and install, then retry:
python3 --version
Note about "python" vs "python3"
On macOS, python may point to something else (or not exist). Prefer python3 and pip3 for Python
3.
Page 4