Python Tutorial / Install Python on Windows and Verify the Interpreter
On Windows, the official Python Install Manager can install an interpreter and let you check its version and executable path. Inspect any existing installation first, then create a separate environment for the course.
Inspect the current commands
Open PowerShell and run these commands individually. A missing installation or command may produce an error. Get-Command shows which file a command name resolves to; this matters when several Python installations are available.
Get-Command python, py -ErrorAction SilentlyContinue python --version py --version
A Python runtime bundled with another application may belong to that application. Keep working environments intact and give this project its own virtual environment. The virtual environment and pip guide explains the separation in more detail.
For the relevant APIs and platform requirements, see Install Python on Windows and Verify the Interpreter documentation.
Install through the official manager
- Obtain Python Install Manager from python.org or the Microsoft Store entry linked by Python’s official documentation. Check the source and publisher.
- Open the downloaded MSIX and follow the installer. If organizational policy blocks it, use the installation method approved for your machine.
- Close old terminal windows, open a new PowerShell window and install the Python 3.12 series used for the course.
py install 3.12 py -V:3.12 --version py -V:3.12 -c "import sys; print(sys.executable)"
py install belongs to the new Install Manager. An older Python Launcher may also own the command name py, so a failure can indicate a command conflict rather than a missing Python release. Inspect the resolved command and follow the official troubleshooting guidance. Installer screens and default versions can change.
Create the project environment
Create the practice folder, enter it and build .venv with the chosen interpreter. Calling its executable explicitly works even when activation is unavailable because of PATH or PowerShell policy.
mkdir python-lab cd python-lab py -V:3.12 -m venv .venv .\.venv\Scripts\python.exe --version .\.venv\Scripts\python.exe -m pip --version
Use a separate environment for each project. Recreate it and reinstall dependencies on a new computer instead of copying the .venv directory. Store your source code alongside .venv, rather than inside it.
Verify execution and diagnose common failures
.\.venv\Scripts\python.exe -c "print(3500 + 8000 + 2500)"
The calculation should print 14000. If a command opens the Microsoft Store, inspect the execution aliases and confirm whether the interpreter is installed. A new terminal may be necessary after PATH changes. Reinstalling every package globally with administrator privileges does not resolve an interpreter mismatch.
Before uninstalling a runtime, identify projects and virtual environments that depend on it. Removing the interpreter differs from deleting a script; retain your source files and dependency records independently.






