If Python is installed but won’t run on Windows 11 — commands like python or pip return errors, or nothing happens — this guide walks you through the most common fixes. You’ll learn how to diagnose the issue, correct your PATH, reinstall cleanly, and handle environment problems.
What You’ll Need
- A Windows 11 PC with administrator access (to install or modify system settings).
- The official Python installer (if a reinstall is needed) from python.org.
- An internet connection for downloading updates or packages.
Step-by-Step
- Check if Python is actually installed.
Open Command Prompt (press Win, typecmd, press Enter). Typepython --versionand press Enter. If you see something likePython 3.12.1, Python is installed. If you get'python' is not recognized, it’s either not installed or not in your PATH. - Check the Python installation folder.
If the command fails, look for Python manually. Open File Explorer and navigate toC:\Users\YourUserName\AppData\Local\Programs\Python(if installed per-user) orC:\Python(if installed system-wide). If you find a folder likePython312, note the full path. - Use the Windows App execution alias.
Windows 11 has built-in aliases for Python that can interfere. Go to Settings > Apps > Advanced app settings > App execution aliases. Look forpython.exeandpython3.exe. If they are enabled, disable them, then trypython --versionagain. These aliases often point to the Microsoft Store stub, which doesn’t work as expected. - Check the PATH environment variable.
In the Start menu, search for “environment variables” and select Edit the system environment variables. Click Environment Variables. In the User variables or System variables, selectPathand click Edit. Ensure the Python installation folder (e.g.,C:\Users\YourName\AppData\Local\Programs\Python\Python312) and itsScriptssubfolder (e.g.,...\Python312\Scripts) are listed. If not, add them. Click OK to save. - Try the
pylauncher.
Windows often installs the Python launcher. In Command Prompt, typepy --version. If that works, you can usepyinstead ofpythonfor all commands. To makepythonwork too, you can addpyas an alias or use the full path. - Repair or reinstall Python.
If nothing works, reinstall Python. Download the latest stable version from python.org. Run the installer. Important: Check the box “Add Python to PATH” at the bottom of the first screen. Then click Install Now. After installation, restart Command Prompt and test again. - Check for multiple Python installations.
If you have both the Microsoft Store version and the official one, they can conflict. Uninstall the Microsoft Store version via Settings > Apps > Installed apps. Keep only the official one. - Test pip.
Oncepython --versionworks, typepip --version. If pip is not recognized, usepython -m pip --version. If that works, you can usepython -m pipfor all package installs. - Open a new terminal.
After any PATH change, close and reopen Command Prompt or PowerShell. Old sessions keep the old PATH.
Common Mistakes
- Not checking “Add Python to PATH” during installation. This is the #1 reason Python doesn’t work after installation.
- Editing the wrong PATH variable. Make sure you add the correct folder path, and don’t accidentally delete existing entries.
- Using the Microsoft Store alias. The aliases in Windows 11 can cause confusion; disabling them often fixes the issue.
- Forgetting to restart the terminal. PATH changes only apply to new sessions.
- Having both 32-bit and 64-bit Python. Uninstall one to avoid conflicts.
Tips
- Use the
pylauncher if you have multiple Python versions; it lets you specifypy -3.11orpy -3.12. - Create a virtual environment for each project to avoid package conflicts:
python -m venv myenv. - Run
where pythonin Command Prompt to see which Python executable is being used. - Keep Python updated to the latest patch version to avoid known bugs.
Troubleshooting
If python --version still fails after following the steps:
- Check the exact error message. If it says
Access is denied, run Command Prompt as administrator. - If you see
Python was not found; run without arguments to install from the Microsoft Store, the alias is still active. Revisit Step 3 and disable both aliases. - If you manually added the PATH but it still doesn’t work, double-check the folder name. It might be
Python313instead ofPython312. - Try running
C:\Users\YourName\AppData\Local\Programs\Python\Python312\python.exe --versiondirectly. If that works, the PATH is wrong. - If the installer fails, run it in compatibility mode: right-click the installer, select Properties > Compatibility, and run as administrator.
- If you have a corporate or managed PC, group policy might block Python. Contact your IT admin.
If Python works but pip doesn’t:
- Run
python -m pip install --upgrade pipto fix pip itself. - If you get a
ModuleNotFoundError, your Python installation is corrupted. Reinstall.
Frequently Asked Questions
Why does Windows 11 open the Microsoft Store when I type “python”?
This happens because the App execution alias is enabled. Disable it in Settings > Apps > Advanced app settings > App execution aliases.
Is Python preinstalled on Windows 11?
No, Windows 11 does not come with Python. You need to install it manually, either from the Microsoft Store or from python.org.
Should I install Python from the Microsoft Store?
It’s possible, but the official python.org installer gives you more control over PATH and installation location. For most users, the official installer is recommended.
How do I add Python to PATH manually?
Go to System Properties > Environment Variables, find the Path variable, edit it, and add the full path to your Python folder (e.g., C:\Users\YourName\AppData\Local\Programs\Python\Python312) and its Scripts subfolder.
Why does my Python script run but immediately close?
That’s normal when you double-click a .py file. Add input() at the end of the script, or run it from Command Prompt to see the output.
Can I have multiple Python versions installed?
Yes, but use the py launcher to select which one runs. For example, py -3.11 runs Python 3.11.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Reset a Beats Pill and Fix Bluetooth Pairing
- iPhone Stuck on Install Now? Fixes That Work
- How to Install an Internal SSD: Step-by-Step Guide
- Fix No WiFi Networks Found in Windows 10
- How to Terminate Built-in Apps in Windows 10
- Fix USB Code 43 Error in Windows