Skip to content

Python Not Found Error on Windows

The common error message "Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases" occurs when Windows cannot locate your Python installation or when Windows App Execution Aliases are interfering with command line execution.

Root Cause

This issue typically happens when:

  1. Python is not installed on your system
  2. Python is installed but not added to the system PATH
  3. Windows App Execution Aliases are overriding your installed Python
  4. The Python installation was incomplete or corrupted

Solutions

1. Disable App Execution Aliases (Quick Fix)

IMPORTANT

This is often the most immediate solution for the specific error message mentioned.

  1. Open Windows Search (⊞ Win + S)
  2. Type "Manage App Execution Aliases" and select it
  3. Turn off both "App Installer" entries for Python

Manage App Execution Aliases Settings

2. Verify and Add Python to System PATH

If Python is installed but not recognized:

  1. Locate your Python installation directory (common locations):

    • C:\Users\[Username]\AppData\Local\Programs\Python\Python[Version]
    • C:\Program Files\Python[Version]
  2. Add to System Environment Variables:

    • Right-click Start → System → Advanced system settings
    • Click "Environment Variables"
    • Under "System variables", find and select "Path" → Edit
    • Add these two paths (replace with your actual paths):
txt
C:\Users\[Username]\AppData\Local\Programs\Python\Python311
C:\Users\[Username]\AppData\Local\Programs\Python\Python311\Scripts

Environment Variables Configuration

TIP

Add these to System variables rather than User variables for system-wide access.

3. Reinstall Python Correctly

If Python isn't installed or was installed incorrectly:

  1. Download Python from the official website: python.org
  2. During installation: Check "Add python.exe to PATH"
  3. Optional but recommended: Choose "Customize installation" and ensure all components including pip are selected

Python Installation with PATH Option

4. Alternative Commands to Try

If the above solutions don't work immediately, try these command alternatives:

bash
# Use the Python launcher with explicit version
py -3 --version

# Or try python3 instead of python
python3 --version

# For pip operations with the Python launcher
py -3 -m pip install --upgrade pip

5. Verify Installation and Environment

Check what Python installations Windows can detect:

bash
# List available Python installations
where python

# List available Python launcher installations
where py

Advanced Troubleshooting

For IDE Users (VS Code, PyCharm)

If you're using an IDE and encountering this issue:

  1. Check which Python interpreter your IDE is using
  2. Copy that path and add it to your system PATH variable
  3. Restart your IDE after making changes

For Anaconda/Miniconda Users

Anaconda users might need to:

  1. Ensure Conda environment is activated
  2. Use python instead of python3 in commands
  3. Check that Anaconda paths are in your system PATH

Prevention

To avoid this issue in the future:

  • Always check "Add Python to PATH" during installation
  • Install Python to a standard location (not user-specific folders)
  • Regularly update your Python installation
  • Consider using virtual environments for project-specific dependencies

When All Else Fails

If you've tried all solutions and still encounter issues:

  1. Restart your computer - Environment variable changes often require a restart
  2. Check for multiple Python installations - Remove conflicting versions
  3. Use the Python Windows Store app - Though limited, it can work for basic needs
Manual Pip Installation (Last Resort)

If pip is missing entirely:

  1. Download get-pip.py: bootstrap.pypa.io/get-pip.py
  2. Run: python get-pip.py or py -3 get-pip.py
  3. Verify with: pip --version

By following these steps, you should resolve the "Python not found" error and be able to use Python and pip normally from the command line.