Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases
Jaya Prakash Narayana Raavi
Data Analyst @ Herff College of Engineering | Master's in Data Science
If you’ve ever tried running python in your Windows command prompt and encountered this error:
“Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.”
You’re not alone. This issue occurs when Python is either not installed, not properly added to the system PATH, or the Windows execution alias interferes with detection.
In this guide, I’ll walk you through the step-by-step process to fix this issue and set up Python correctly on your Windows system.
1. Check If Python is Installed
Before doing anything else, let’s verify whether Python is already installed.
where python
or
where python3
C:\Users\YourUsername\AppData\Local\Programs\Python\PythonXX\python.exe
2. Install or Reinstall Python
If Python is missing or needs a fresh install, follow these steps:
3. Add Python to System PATH Manually (If?Needed)
If you installed Python but it’s still not recognized, you may need to add it to your system’s environment variables.
Step 1: Find Python’s Installation Path
Python is typically installed in one of these locations:
C:\Users\YourUsername\AppData\Local\Programs\Python\PythonXX\
C:\PythonXX\
(Replace XX with the actual version number.)
Step 2: Add Python to?PATH
C:\Users\YourUsername\AppData\Local\Programs\Python\PythonXX\
C:\Users\YourUsername\AppData\Local\Programs\Python\PythonXX\Scripts\
5. Click OK and restart your computer.
After restarting, open Command Prompt and type:
python --version
If you see the Python version number, you’re all set!
4. Disable Microsoft Store Python?Alias
Windows sometimes redirects python commands to the Microsoft Store. To prevent this:
This ensures Windows uses your installed Python instead of redirecting to the Microsoft Store.
5. Verify Python Installation
After applying these fixes, test Python by running:
python --version
python3 --version
You should see an output like:
Python 3.X.X
If it works, you’re now ready to start coding! ??
6. Creating and Using a Virtual Environment
A virtual environment helps isolate project dependencies. Here’s how to create one:
python -m venv venv
To activate it:
venv\Scripts\activate
source venv/bin/activate
You should now see (venv) in your terminal prompt, meaning the virtual environment is active.
Final Thoughts
Setting up Python correctly on Windows can sometimes be tricky, but following these steps should resolve the “Python not found” error.
Junior Software Engineer | Developer | Technology | C++ | Python | Data Analysis | Automotive Systems | AutoSar
3 周Awesome!