Elemental SystemsSilicon · Boards · Software

Set Up Your Language · 2 of 14

Setting Up Python

Python is a programming language known for being easy to read. It is used for small helper scripts, websites, data analysis, science and most of today's artificial intelligence work. On Windows it is installed with the Python install manager, a small official tool that downloads Python and keeps it up to date.

Set-up: EasyOfficial source: python.orgFile ending: .py

New to all this? Read Before you start on the main page first: it shows how to open Terminal, make a folder for your code, and see file name endings. It takes five minutes and prevents most problems.

1 What to download, and from where

Download only from python.org, the official Python website, run by the Python Software Foundation. Other download sites can bundle unwanted software.

  1. Go to python.org/downloads.
  2. Click Download Python install manager (on Windows the page offers it first). The page links to the Microsoft Store, which python.org recommends for most people.
  3. In the Microsoft Store page for Python Install Manager (publisher: Python Software Foundation), click Get or Install.

2 Install it on Windows

  1. Wait for the Store to say it is installed. That installs the manager, not Python itself yet.
  2. Open Terminal (press the Windows key, type Terminal, press Enter).
  3. Type python and press Enter. The first time, the manager notices no Python is installed and downloads the latest version for you.
  4. It may ask a few questions, for example whether to add a folder to your PATH. Type y and press Enter to accept the suggestions.
  5. When it finishes you will see >>>: that is Python waiting for you. Type exit() and press Enter to leave.

3 Check that it worked

Close every Terminal window you have open and open a new one. A Terminal that was already open does not know about programs installed after it started. Then type this and press Enter:

python --version

What you will see: The word Python and a version number. Any version starting with 3 is right.

Python 3.14.0

If you see an error such as "is not recognized" instead, look at the common mistakes at the bottom of this page.

4 Write and save your first program

A program is just a text file. You can write it in Notepad, which comes with Windows. (Later you may like the free Visual Studio Code editor from code.visualstudio.com, which colours the code and helps spot mistakes.)

  1. Open Notepad (press the Windows key, type Notepad, press Enter).
  2. Type the program below, or click Copy and paste it in with Ctrl + V. Every symbol matters, so copy it exactly.
    print("Hello, World!")
  3. In Notepad choose File → Save as. Go to your C:\code folder. Set Save as type to All files (*.*), type the file name hello.py exactly as shown, including the dot and the ending, and click Save.

print shows the text inside the brackets and quotes on the screen.

Do not use Word. Word saves extra formatting and changes straight quotes " into curly ones “ ”, which no programming language accepts.

5 Run it and see the result

Open File Explorer, go into your C:\code folder, right-click an empty part of the window and choose Open in Terminal. (More ways to open Terminal.) If Terminal was already open from the check above and is in another folder, type cd C:\code and press Enter.

Type this and press Enter:

python hello.py

What you will see: the words below on a new line. That is your program running.

Hello, World!

Congratulations: you have written and run a Python program.

6 Common beginner mistakes and how to fix them

Error messages look alarming but are usually precise: read the first line, and look for a line number. If you are stuck, copy the whole error message and paste it into an AI assistant along with your code, and ask what it means.

Typing python opens the Microsoft Store, or says "Python was not found"

Why: Windows has a built-in shortcut named python that points to the Store.
Fix: open Settings, search for Manage app execution aliases, and make sure the entries named Python (default) are switched On (and any older "App Installer python.exe" entries are Off). Close and reopen Terminal. Also try py instead of python: it is the same thing.

SyntaxError when typing python hello.py

Why: you are inside Python's >>> prompt, which only understands Python code, not Terminal commands.
Fix: type exit() and press Enter. When the prompt changes back to something like PS C:\code>, type python hello.py.

NameError: name 'Print' is not defined, or SyntaxError: Missing parentheses

Why: Python is case-sensitive, and needs brackets. Print and print "Hello" (an old style from Python 2 found in old tutorials) both fail.
Fix: write it exactly as print("Hello, World!"), all lower case, with brackets.