Beginner guides › Install Python
Install Python on Windows or Mac
Some projects, like file sorters and photo renamers, are Python scripts rather than web pages. They need Python on your computer. Here's how to install it, check it works, and run your first script.
Only for scripts and programs
Every web page project on this site runs in your browser, so you don't need Python for those. You need it when a guide says "Python script", or when the AI gives you a file ending in .py.
Python is free, made by a non-profit, and used by millions of people. Installing it is safe and you can remove it later like any other app.
Install Python on Windows
Download it
Go to python.org/downloads and click the big yellow download button. It picks the right version for your computer.
Run the installer
Open the file you downloaded. If you see a checkbox saying Add python.exe to PATH, tick it, then click Install Now. If you're offered the newer Python install manager instead, run it and say yes to its questions.
That checkbox matters. It's what lets you typepythonlater. If you missed it, run the installer again and choose Modify, or see Quick fixes below.Check it worked
Press the Windows key, type Terminal (or Command Prompt) and open it. Type this and press Enter:
Type thispython --version
You should see something like Python 3.14.0. The exact number doesn't matter.
Install Python on a Mac
Download it
Go to python.org/downloads and click the yellow download button for macOS.
Run the installer
Open the .pkg file and click through with Continue and Install. Enter your Mac password when asked. When it finishes, a Finder window opens: double-click Install Certificates.command in it. This lets Python download things safely.
Check it worked
Press Cmd+Space, type Terminal and press Enter. Type this and press Enter:
Type thispython3 --version
On a Mac it's python3. Usepython3wherever a guide sayspython, andpip3forpip.
Run something the AI wrote
Ask for a tiny test script
Copy this promptI'm a complete beginner and I've just installed Python. Please write me a very short Python script that asks for my name and then says hello and tells me today's date. Give me the complete script, tell me what to name the file, and tell me exactly how to run it on [Windows / Mac].
Save it as a .py file
Save it the same way as an HTML file (see How to save and open an HTML file), but end the name with .py, for example hello.py. Make a folder for your scripts, such as Documents › scripts.
Open a terminal in that folder
Windows: open the folder in File Explorer, click the address bar, type cmd and press Enter. A terminal opens in that folder.
Mac: open Terminal, type
cdand a space, drag the folder from Finder into the Terminal window, then press Enter.Run it
Type the command below (use
python3on a Mac) and press Enter. Answer its question and it says hello back.Type thispython hello.py
Installing add-ons with pip
Some scripts need an add-on, called a package. The AI will tell you its name, for example pygame for games or openpyxl for Excel files. Install it like this, in a terminal (Mac users type python3):
python -m pip install pygame
Quick fixes
Windows says 'python' is not recognised
Python isn't on your PATH. Try typing py instead of python. If that doesn't work, run the installer again, choose Modify, and tick Add Python to environment variables. Close and reopen the terminal afterwards.
Typing python opens the Microsoft Store
Windows has a shortcut that does this. Either install Python from python.org as above, or turn the shortcut off: Settings › Apps › Advanced app settings › App execution aliases, and switch off the two python entries.
Mac says 'command not found: python'
On a Mac the command is python3. If that's not found either, the installer didn't finish: run it again.
No such file or directory
The terminal isn't in the same folder as your script. Repeat the step above to open a terminal in the right folder, or check the file name really ends in .py and not .py.txt.
SSL or certificate errors when installing a package (Mac)
Open Applications › Python 3.x in Finder and double-click Install Certificates.command, then try again.
What about a Chromebook?
You can turn on Linux in Settings › About ChromeOS › Developers › Linux development environment. Python comes with it. Most school and work Chromebooks block this, so ask your administrator.