ShareYourGroupShareYourGroupPython

How to set up Python on a computer or phone

You need some way to run Python before lesson 1. There are three routes. Choose the one that matches the device you have. All three are free.

Route 1: install Python on a computer

This is the best route if you have a laptop or desktop. Python is free software, published by the Python Software Foundation on its official website, python.org.

Windows

  1. Open python.org in your browser and go to Downloads. The site offers the current version for Windows. Download the installer.
  2. Run the installer. On its first screen, tick the box that adds Python to PATH before you continue. This lets you start Python from the Command Prompt later. It is the step most people miss.
  3. Choose the standard install and wait for it to finish.
  4. Open the Start menu and type IDLE. Open the program called IDLE. It was installed along with Python.

Download Python only from python.org or from the Microsoft Store entry published by the Python Software Foundation. Do not use download sites that wrap the installer in their own program.

Mac

  1. Open python.org, go to Downloads, and download the installer for macOS.
  2. Open the downloaded file and follow the steps.
  3. Open Launchpad or the Applications folder and start IDLE from the Python folder.

Linux

Most Linux systems already have Python 3. Open a terminal and type python3 --version. If a version number appears, Python is there. IDLE is usually a separate package in your system's software manager.

Check that it works

Open the Command Prompt on Windows, or the Terminal on Mac and Linux, type the line below and press Enter.

python --version

A line such as "Python 3" followed by more numbers means the install worked. If Windows says the command is not found, try py --version. On Mac and Linux the command is usually python3.

Your first file in IDLE

IDLE opens a window called the Shell, with a >>> prompt. You can type one line there and press Enter to run it at once. That is good for quick tests. For programs of more than a line or two, use a file.

  1. In IDLE choose File, then New File. An empty editor window opens.
  2. Type your program, for example print("Hello, world").
  3. Choose File, then Save. Give it a name ending in .py, such as hello.py, in a folder you will find again. A folder named python-practice in Documents is a good home.
  4. Press F5, or choose Run, then Run Module. The output appears in the Shell window.

Do not name a file after a Python module, such as random.py or math.py. It causes confusing errors later, explained on the AttributeError page.

A better editor, later

IDLE is plain but enough for this whole course. When you want more comfort, free code editors colour your code, complete names as you type and point out mistakes before you run. There is no hurry. Changing editors does not change the language.

Route 2: run Python in a browser

Many websites offer a box where you type Python and press Run. Search for "online Python compiler" or "run Python online". Nothing is installed, and it works on school and office computers where you cannot install software.

Things to know:

Route 3: Python on a phone

Both app stores have free apps that run Python on the phone itself. Search the Play Store or the App Store for "Python" and choose an app with many good reviews, checking what permissions it asks for. An app that runs Python has no need for your contacts or location.

A phone is fine for the first ten lessons. Typing brackets, colons and indents on a small keyboard gets tiring as programs grow, so try to practise on a computer at least sometimes. If the phone is all you have, turn it sideways for a wider keyboard and be patient with yourself. Many people have learnt this way.

Which Python version?

Any recent version of Python 3 will do for every lesson on this site. Do not install Python 2. It is no longer supported, and its print works differently, which is why some very old tutorials show code that fails today.

Common set-up problems

ProblemLikely causeWhat to do
"python is not recognized" on WindowsPATH box not tickedRun the installer again, choose Modify or Repair, and tick the PATH option. Or use py in place of python.
The Microsoft Store opens when you type pythonWindows shortcut for a missing PythonInstall Python from python.org, then open a new Command Prompt.
Double-clicking the file shows a black window that vanishesThe program ran and finishedRun it from IDLE with F5, where the output stays.
The file opens in NotepadNo .py ending, or the ending is hiddenSave from IDLE with a name ending in .py.

Once print("Hello, world") runs, you are ready for lesson 1.

Examples on this page were run with Python 3.14 on 12 November 2026. The output shown is the real output.

This is an independent learning site. It is not connected with or approved by the Python Software Foundation. "Python" is a trademark of the Python Software Foundation and is used here only to name the language.