Welcome to your Python course. In this first module, you will set up a dependable workflow on your Windows computer: verify Python, configure VS Code, create files, and run programs. Today’s goal is deliberately small but essential: confirm that Windows can find a working Python interpreter using py --version.
Python is a language, but your computer needs the Python interpreter to run Python code. On Windows, py is commonly the Python Launcher: it locates an installed Python version and starts it for you.
See the version check once
Because you prefer learning by doing, perform the check yourself first. This brief clip from How to set up Python on Visual Studio Code by Kenny Yip Coding shows the command and the kinds of result you may see.
How to set up Python on Visual Studio Code
Watch this short demonstration to see where the version command is entered and what a successful result looks like.
Watch the version check. Focus on the distinction between a version number, which signals success, and an unrecognized-command message, which signals that Windows cannot use that command.
Run the check in PowerShell
- Press the Windows key.
- Type PowerShell.
- Open the app named Windows PowerShell or simply PowerShell.
- In the window that opens, type this command exactly:
py --version
- Press Enter.
Do not type the prompt text that PowerShell displays before your cursor. For example, if it shows something like PS C:\Users\YourName>, type only py --version after it.
A successful result looks similar to this:
Python 3.13.2
Your numbers will probably differ, and that is normal. The important part is that the output begins with:
Python 3
Python version numbers generally have three parts:
Python 3.13.2
│ │ │
│ │ └─ bug-fix release
│ └──── feature version
└────── major version
For this course, any current Python 3 version is the key result. Record the version you see somewhere convenient, such as a note in your project folder; it can help later if you need troubleshooting.
Understand your result
py --version asks the Windows Python Launcher to select an installed Python interpreter and report its version. It does not start a Python program or make any changes to your computer.
Use this table to interpret what happened:
| What you see | Meaning | What to do now |
|---|---|---|
Python 3.x.y | Success. A Python 3 interpreter is installed and the py launcher found it. | Keep PowerShell available; you are ready for the next setup step. |
A message that py is not recognized | Windows cannot find the Python Launcher. Python may be missing, or it may have been installed in a way that does not include py. | Try the diagnostic command below. |
| A message saying no Python runtime/interpreter was found | The launcher exists, but it cannot find an installed Python version to run. | Python needs to be installed or repaired before continuing. |
| A Microsoft Store prompt or Python-not-found message | Windows did not find a usable Python installation through this command. | Python needs to be installed or its command setup needs attention. |
If py --version fails, run this diagnostic command:
python --version
There are two common cases:
- If
python --versionshowsPython 3.x.y, then Python is installed, but thepylauncher is unavailable. Microsoft Learn notes that some installation methods, including the Microsoft Store version described in its guidance, may not include thepycommand. - If both commands fail, Python is not currently available from your terminal. Do not try to guess at a fix from an error message; note the exact message so you can resolve the installation cleanly before configuring VS Code.
A version check can be useful whenever a program behaves differently on another computer. It tells you exactly which Python interpreter that terminal will use.
Why this check matters for the rest of the course
You will soon write files ending in .py, such as:
greeting.py
VS Code can help you write that file, but it still needs a Python interpreter to run it. Verifying py --version first separates two possible problems:
- Python itself is unavailable in Windows.
- VS Code is not configured to use the available Python.
Today’s command tests the first. The next lesson addresses the second.
Before moving on, make sure you can truthfully check this off:
- I opened PowerShell.
- I ran
py --version. - I saw a
Python 3...version number, or I recorded the exact error message I received. - I understand that
pyis a Windows launcher that finds a Python interpreter.
You have now performed the first environment check: py --version confirms which Python 3 interpreter PowerShell can run. Next, you will install the Microsoft Python extension in VS Code and select the interpreter that VS Code should use.
Can't find a good explanation? Sign up and we'll make it for you
Sign up