How to Install Python on Windows the Right Way

Windows does not ship with a Python you are meant to rely on, so you install one yourself. The steps have changed in recent years: the official Python documentation now recommends a tool called the Python install manager instead of the classic double-click installer. This guide explains that route, how to check that it works, and how to avoid the problems that trip up most newcomers. The software itself is covered on the Python page.
Why the install manager
The Python docs state plainly that Windows has no system-supported installation of Python and that you can obtain it from several distributors, including directly from the CPython team. To get Python from the CPython team, they point you at the install manager, a standalone tool that:
- makes Python available as global commands in any terminal,
- integrates with the system, and
- supports updates over time.
You can get it from python.org/downloads or from the Microsoft Store. The documentation says the two versions are identical, so pick whichever fits how you normally install software. The python.org downloads page also still offers traditional installers and embeddable packages for situations where the manager is not suitable, for example some automated deployments.
Step 1: Get the install manager
- Open the official Python site (python.org) and go to the Windows downloads page, or search for Python in the Microsoft Store.
- From the site, download the install manager file and double-click it, then choose Install. From the Store, simply click Install.
- When it finishes, open a new terminal window. Windows Terminal works well, but the classic Command Prompt and PowerShell do as well.
Open a fresh window after installing, because terminals that were already open do not see new commands.
Step 2: Install a Python runtime and check it
Type:
python
If no runtime is installed yet, the docs explain that launching Python makes the manager offer to fetch the one requested, and you can also do it deliberately with py install. To see what is present, run:
py list
This lists installed runtimes and shows which is current. You can also view versions available for download with py list --online. When you first install a runtime you may be asked whether to add a directory to your PATH. The documentation calls this optional if you are happy to use the py command, and recommends it for people who want the full range of aliases such as python3.15.exe. The default folder is under %LocalAppData%\Python\bin, and you can edit your account's environment variables from the Start menu by searching for "Edit environment variables for your account".
To start a particular version when several are installed, use the -V: option:
py -V:3.15
Replace the tag with the version you want. py help lists the other commands.
Type exit() to leave the interactive prompt.
Step 3: Use a virtual environment for every project
The Python docs recommend a separate virtual environment for each project. It keeps packages isolated, keeps behavior consistent over time, and makes sure commands added by packages are available when the environment is active. To create and use one:
mkdir my-project
cd my-project
python -m venv .venv
.venv\Scripts\Activate
Your prompt changes to show the environment is active. Anything you install now goes into the project folder rather than the system-wide install. Run deactivate when you are done. Next time, run the Activate script again from the project folder.
To install a package inside an active environment, use pip through Python:
python -m pip install requests
Calling pip as python -m pip guarantees it belongs to the interpreter you are using, which avoids the classic mix-up between several installs.
Step 4: Write and run a script
Create hello.py with one line, print("Hello from Python"), in your project folder. In the terminal, run python hello.py. If the text appears, your setup is complete. A code editor makes this easier day to day: Visual Studio Code has an official Python extension, and it can pick up the environment you created if you open the project folder.
Step 5: Track your work with Git
As soon as a script is worth keeping, put the folder under version control with Git for Windows. Add .venv to a .gitignore file so the environment itself is not committed. The requirements.txt approach, which lists package names for others to reinstall, is the usual way to share dependencies.
Fixing "command not found" or the Store opening
These are the most common complaints, and the official troubleshooting table covers them:
pythonsays command not found, or opens the Microsoft Store. First confirm the install manager is installed. Then open Start, search for Manage app execution aliases, and check that the alias for Python (default) is enabled. If it already is, switch it off and on again to refresh it. The aliases for the windowed Python and for the install manager may need the same treatment.pyis not found. Same checks. Also make sure your PATH still contains%UserProfile%\AppData\Local\Microsoft\WindowsApps, an entry Windows adds by default. If someone removed it, shortcuts will not be found.- You have an older Python on PATH. The docs warn that existing installations or edited PATH entries can interfere, and suggest removing them or undoing the changes.
Housekeeping
The install manager updates itself, and the documentation notes this does not change the runtimes you have installed. Uninstalling the manager does not remove runtimes either. To move to a newer Python version, install it with py install and create fresh virtual environments for your projects, rather than upgrading an environment in place.
Quick checklist
- Install the manager from python.org or the Store.
- Open a new terminal and run
py list. - Create one virtual environment per project with
python -m venv. - Use
python -m pipto install packages. - If a command is missing, check app execution aliases and PATH before reinstalling anything.
Software in this article
Comments
No comments yet.





