How to Solve 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 when running python script in Windows

Posted on

Introduction

First of all, this article is showing alternative way to solve an error message. The error message itself exist as part of the title in this article. Furthermore, the error message appear upon executing a command using ‘python’ or ‘py’ command. In this case, it execute a script for installing pip tool. Actually, the instruction for installing pip tool exist in an article in this link. It is an article with the title of ‘How to Install pip in Microsoft Windows’. Before going on to the solution, the following is the actual execution of the command generating the error message :

C:\Users\Administrator>cd Downloads

C:\Users\Administrator\Downloads>py get-pip.py
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

C:\Users\Administrator\Downloads>py
Python 3.10.0 (tags/v3.10.0:b494f59, Oct  4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()

C:\Users\Administrator\Downloads>python get-pip.py
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

C:\Users\Administrator\Downloads>py -V
Python 3.10.0

C:\Users\Administrator\Downloads>

As in the above command execution, there is an error message appear which is preventing the command to install ‘pip’ tool.

 

Solution

Finally, in order to solve the problem, this part will discuss the solution. Actually, while googling it with the keyword containing the error message above, the solution exist in this link. It is a stackoverflow site page with the title of ‘Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings’. The solution itself actually consists of two parts. The first part is just to make sure that the requirement for solving the problem is actually available. The second part is the additional solution and also the execution of the command for testing the solution.

Checking the Requirements

There are several things which are the main requirements for solving the solution. In this context, the solution confirming the requirement to solve the problem exist as follows :

  1. Check whether python is exist. But according to the previous part, it exist since ‘py’ or ‘py -V’ command’s execution is possible.

  2. Check the environment variable. This is also already exist since the execution of ‘py’ or ‘py -V’ command take place not in the main installation or main path of the python binary file. In this case, it exist in ‘C:\python-3.10’.

Executing additional Solution

Last but not least which is actually the reason why the error appear is to be able to implement the following solution step. This is the solution which is exactly suitable for the error message :

  1. Just turn off the ‘App execution aliases’. But before that, type Manage app execution aliases in the start search textfiled which it will appear as follows :

    How to Solve 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 when running python script in Windows
    How to Solve 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 when running python script in Windows
  2. After executing the ‘Manage App Execution aliases’ link, there will be a window appear as follows :

    How to Solve 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 when running python script in Windows
    How to Solve 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 when running python script in Windows
  3. Just switch off the Application aliases for ‘python’ and ‘python3’. In the end, the display and appearance will exist as follows :

  4. Last but not least, the following is an attempt to execute the command once more. The following is the attempt of the command execution after changing the Application manage execution aliases for ‘python’ and ‘python3’ :

    C:\Users\Administrator>cd Downloads
    
    C:\Users\Administrator\Downloads>py get-py.py
    C:\python-3.10\python.exe: can't open file 'C:\\Users\\Administrator\\Downloads\\get-py.py': [Errno 2] No such file or directory
    
    C:\Users\Administrator\Downloads>py get-pip.py
    Collecting pip
      Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
    Collecting wheel
      Downloading wheel-0.37.0-py2.py3-none-any.whl (35 kB)
    Installing collected packages: wheel, pip
      WARNING: The script wheel.exe is installed in 'C:\python-3.10\Scripts' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
      Attempting uninstall: pip
        Found existing installation: pip 21.3.1
        Uninstalling pip-21.3.1:
          Successfully uninstalled pip-21.3.1
      WARNING: The scripts pip.exe, pip3.10.exe and pip3.exe are installed in 'C:\python-3.10\Scripts' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    Successfully installed pip-21.3.1 wheel-0.37.0
    
    C:\Users\Administrator\Downloads>
    

 

Leave a Reply