Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

If you have not installed Python on your windows machine or if the path environment variables are not set properly in windows you will get Python was not found error.

In this tutorial, we will learn how to resolve Python was not found; run without arguments to install from the Microsoft Store error

How to solve Python was not found; run without arguments to install from the Microsoft Store

The error mainly occurs in the windows operating system and there are different reasons to get this issue. Let us take a look at each of these scenarios and solutions.

Scenario 1: Python is not installed

The main reason could be that Python software itself is not installed on the windows machine and, you are trying to execute Python scripts or installing the packages.

This is a rare scenario where some beginners think that by default the Python software is shipped with windows and try to run the Python scripts.

Solution 

The solution is pretty straightforward and, we can download the latest version of Python from the official source and install it in windows to resolve the issue.

Scenario 2: Environment variables are not set properly

The second scenario could be you have installed the Python software, but when you run the scripts or the project through the command line, you get Python was not found error. 

It happens because the environment path variable does not exist for Python. 

Solution 

You can resolve the issue by setting the environment path variable for Python as shown below.

Step 1: Find the installed path of the Python software if you have installed it in a different location. The default installation path for Python 3.7+ versions is located as shown below.

Step 2: Copy the two Python paths. Replace the <user_name> with your actual user name. 

C:\Users\<user_name>\AppData\Local\Programs\Python\Python39
C:\Users\<user_name>\AppData\Local\Programs\Python\Python39\Scripts

Step 3: These are the Path for the Python interpreter. We need to add this into the system environment variable Path as shown in the below screenshot.

Right-click This PC, then go to Properties => Advanced system settings => Environment variables.

Add Python To Path Windows 10
‘python’ is not recognized as an internal or external command, operable program or batch file. 4

Step 4: You’ll see your variables here. Select the PATH variable and click the “Edit” button. In the window that appears when a path variable exists, select it ​and click Edit; otherwise, click New.

Python Was Not Found; Run Without Arguments To Install From The Microsoft Store,
Python was not found; run without arguments to install from the Microsoft Store,

Step 5: Finally, paste the path you copied earlier in Step 1. If your system has many paths linked by semicolons, append the path by prefacing it with a semicolon. Click Ok to save.

Once you have completed all the steps, try running the Python program from your command prompt. You can run the ‘py’ or ‘python’ command, and you should not see any error hereafter. Remember to close all the command prompt windows and reopen them again after completing the above steps. 

Step 5: Restart the machine once and try running the scripts.

Scenario 3: Manage App Execution Aliases

In Windows start, search for Manage App Execution Aliases and turn of the app installers for Python as shown in the below screenshot.

Manage App Exec
Manage App Exec

Scenario 4: Clean Install

If you have tried all the above methods and still it did not work, then you can uninstall the existing Python installation and perform a clean installation of Python.

During the installation, ensure to Add the Path environment variables to set the paths properly.

Adding Python To The Windows Path Environment Variable

Once you re-install the Python, ensure to reboot the windows machine before executing the Python scripts.

Leave a Reply

Your email address will not be published.

Sign Up for Our Newsletters

Get notified of the best deals on our WordPress themes.

You May Also Like
Python String Strip()

Python String strip()

Table of Contents Hide strip() Syntaxstrip() Parametersstrip() Return ValueExample: Working of the strip() methodExample 2 – How to use strip() method in real world? The Python String strip() method is…
View Post
Python Ascii()

Python ascii()

Table of Contents Hide ascii() Syntax ascii() Parametersascii() Return ValueExample 1: How ascii() method works?Example 2: ascii() vs print() The ascii() in Python is a built-in function that returns a printable…
View Post
Python Check If String Is Empty Or Not

Check if string is empty or not in Python

Table of Contents Hide Python program to check if string is empty or notUsing len() funtionUsing not operatorUsing not+str.strip() method Using not + str.isspace method In this article, you will learn…
View Post
Python String Swapcase()

Python String swapcase()

Table of Contents Hide swapcase() Syntaxswapcase() Parametersswapcase() Return ValueExample: Python Program to change the case of a given string Python string swapcase() method is a built-in function that converts all…
View Post