If you’ve just installed Python on Windows 11 and found that it’s not working properly — maybe typing python in Command Prompt shows “not recognized”, or Python scripts don’t run — you’re not alone. This is one of the most common issues developers face when setting up Python on a new Windows machine.
In this guide, we’ll walk you through the main reasons why Python doesn’t work on Windows 11 and show you how to fix it step by step — whether it’s a PATH problem, missing installation component, or version conflict.
Why Python Isn’t Working on Windows 11
Here are the most common reasons Python fails to run or open correctly:
- Python isn’t added to PATH during installation.
- Multiple versions of Python are installed, causing conflicts.
- Corrupted installation files or missing components.
- Antivirus or security restrictions interfering with Python scripts.
- Environment variables misconfigured or missing.
- Running Python from the wrong terminal (e.g., PowerShell vs CMD).
How to Fix “Python Not Working” in Windows 11
Let’s go through each fix one by one.
1. Verify That Python Is Installed
Before troubleshooting, confirm Python is actually installed on your system.
- Press Windows + R, type
cmd, and hit Enter. - Type:
python --versionorpy --version
If you get an error like “python is not recognized as an internal or external command”, it means Python either isn’t installed or isn’t in your PATH.
If it shows a version number (e.g., Python 3.12.0), Python is installed correctly.
2. Add Python to PATH Manually
If Python was installed without checking “Add Python to PATH”, Windows won’t recognize it.
Here’s how to fix it:
- Press Windows + S and search for Environment Variables.
- Open Edit the system environment variables → click Environment Variables.
- Under System variables, select Path → Edit → New.
- Add these two paths (adjust version number accordingly):
C:\Users\<YourUser>\AppData\Local\Programs\Python\Python3XX\ C:\Users\<YourUser>\AppData\Local\Programs\Python\Python3XX\Scripts\ - Click OK to save and close all dialogs.
- Restart Command Prompt and type:
python --versionIt should now display your Python version.
3. Reinstall Python Properly
If adding PATH doesn’t work, your installation might be corrupted.
- Go to Settings → Apps → Installed apps.
- Locate Python, click Uninstall.
- Download the latest version from python.org/downloads.
- During installation, make sure to:
- Check “Add Python to PATH”.
- Choose “Customize installation” → Enable all optional features.
- Select “Install for all users” if possible.
- After installation, reopen Command Prompt and verify using:
python --version
4. Use the “py” Launcher
On Windows 11, the py command is a launcher that handles multiple Python versions.
If python doesn’t work, try:
py
or
py -3
If that works, Python is installed — it’s just not mapped to the python command. You can keep using py safely for scripts and command-line work.
5. Check for Multiple Python Versions
Having multiple Python versions (e.g., from Anaconda, Microsoft Store, or manual installs) can cause confusion.
To check:
- Open CMD and run:
where pythonIt will show all Python paths found. - If you see multiple entries, uninstall old or conflicting versions:
- Anaconda: Uninstall via Control Panel or its uninstaller.
- Microsoft Store Python: Remove via Settings → Apps.
Keep only one main Python version for simplicity.
6. Run Python as Administrator
Sometimes permission issues prevent Python from executing scripts.
- Right-click on Command Prompt → Run as administrator.
- Try running:
pythonIf it works here, adjust Python permissions:- Navigate to the Python folder.
- Right-click → Properties → Security tab → grant Full control to your user account.
7. Repair Microsoft Visual C++ Redistributables
Python requires Visual C++ runtime libraries. If they’re missing, you might face runtime errors.
- Visit Microsoft’s official page for Visual C++ Redistributable.
- Download and install both x64 and x86 versions.
- Restart your PC.
- Try launching Python again.
8. Check Windows App Execution Aliases
Sometimes Windows redirects the python command to the Microsoft Store — even if you installed Python manually.
To fix this:
- Go to Settings → Apps → Advanced App Settings → App Execution Aliases.
- Find Python.exe and Python3.exe entries.
- Turn off both toggles.
- Restart CMD and try
pythonagain.
9. Repair or Reset Python Installation
If the issue persists:
- Go to Settings → Apps → Installed apps.
- Find Python → click Modify.
- Select Repair → follow on-screen steps.
- Once done, test again in CMD.
10. Reboot and Test with a Simple Script
- Open Notepad, type:
print("Hello, Python is working!") - Save it as
test.pyon Desktop. - Open Command Prompt and run:
python Desktop\test.pyIf it prints “Hello, Python is working!”, you’re all set!
Wrapping Up
When Python doesn’t work on Windows 11, it usually comes down to a PATH misconfiguration, conflicting versions, or a corrupted setup.
By verifying the installation, adding Python to PATH, and ensuring no alias or security restrictions interfere, you’ll get Python running smoothly again.
Once it’s fixed, test by running a short script — if it prints successfully, you’re back in business.