Install Python on Windows or Mac

Follow the Windows or Mac steps for your computer. Python runs your code. The terminal is the window where you tell your computer which Python file to run. On Windows, use Command Prompt. If Python is already installed, start with the version command for your computer.

Windows · install Python

1. Open the official Windows download page. Choose Python install manager, then open the downloaded installer and select Install.
Download Python for Windows · https://www.python.org/downloads/windows/

2. Open the Start menu, type Command Prompt, and open it. Type the line below and press Enter. If this is a fresh installation, accept the prompt to install Python and let it finish. If the manager says it needs a Python version, enter py install default, then run the version command again.
py --version
What you should see · A version such as Python 3.14.2. Use Python 3.10 or newer for Foundations.

Windows · open the workbook and run the file

1. If you need the workbook, choose Download workbook (ZIP) on the course page. In File Explorer, right-click the ZIP and choose Extract All, then Extract. Open the extracted folder and make sure you can see workbook.txt. Use that folder for the steps below.

2. Click the address bar in File Explorer. Copy the full folder path with Ctrl+C. In Command Prompt, type cd /d followed by a space. Paste the path between double quotes and press Enter. Replace the sample path with the one you copied.
cd /d "C:\Users\Sam\Downloads\python-foundations-workbook"

3. List the files in this folder. Look for workbook.txt and the setup folder.
dir

4. Run the setup file from this folder. If python --version was the command that worked on your computer, use python instead of py.
py setup\check_python.py
What you should see · Python is ready!

Mac · install Python

1. Open the official macOS download page and choose the macOS installer for a stable Python 3 release. Open the downloaded .pkg and follow the installer.
Download Python for Mac · https://www.python.org/downloads/macos/

2. Press Command–Space, type Terminal and press Return. Type the line below and press Return.
python3 --version
What you should see · A version such as Python 3.14.2. Use Python 3.10 or newer for Foundations.

Mac · open the workbook and run the file

1. If you need the workbook, choose Download workbook (ZIP) on the course page. In Finder, double-click the ZIP to extract the workbook. Open the extracted folder and look for workbook.txt.

2. In Terminal, type cd followed by a space. Drag the extracted workbook folder from Finder into Terminal, then press Return. Terminal fills in the folder path for you.

3. List the files in this folder. Look for workbook.txt and the setup folder.
ls

4. Run the setup file from this folder.
python3 setup/check_python.py
What you should see · Python is ready!

If a command fails

1. If Windows says py is not recognised, open a fresh Command Prompt and try python --version. If it shows Python 3.10 or newer, use python instead of py. If both commands fail, reopen the Python installer and check that installation finished.

2. If Mac says python3 was not found or offers to install developer tools, finish the Python.org installer and open a fresh Terminal. Try python3 --version again.

3. If Python can’t open the file, list the folder again with dir on Windows or ls on Mac. For the setup check, you should see workbook.txt and setup. For a lesson, you should see instructions.txt and its .py files. Change to the right folder and try again.

4. If you see >>>, you opened Python’s interactive prompt. Type exit() and press Enter to return to the terminal. Then run the full command with the file name.
