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

The Python programming language is a favorite among many developers who use it to build web applications, desktop applications, data analysis tools, and machine learning models. Despite this, Python developers of all levels can encounter errors when working with the language. When trying to run a Python script, you may have encountered the error Python Was Not Found Run Without Arguments. 

Why Python Was Not Found Run Without Arguments Error Occur?

This error message may appear for several reasons such as:

  • Python is not installed on your computer
  • Python is not added to your system’s PATH 
  • Conflict due to App installers for Python
  • The Python interpreter is not located in the default location
  • The Python installation is corrupted
  • There is a typo in the command or script

In this article, we will explore the reasons why you might encounter the error message Python was not found; run without arguments and provide practical solutions to help you resolve it. By following the steps outlined in this article, you can successfully execute Python scripts or commands without encountering this error message.

Reason 1

Python is not installed on your computer – The Python interpreter cannot be found if Python is not installed on your computer.

Solution

To execute Python scripts or commands, a Python interpreter is required. The error message Python was not found; run without arguments will appear if the interpreter is not installed on your computer. To resolve this, follow these steps:

  1. Visit Python’s official website and download the latest version for your operating system.
Python was not found; run without arguments to install from the Microsoft Store
  1. After downloading the file, run it and follow the instructions to complete the installation. When installing, you must select the option to Add Python to environment variables as shown below.
Add Python to environment variables
  1. To verify that Python is correctly installed, open the command prompt or terminal and enter the command py. You should be able to see the Python version number on your computer as shown below:
Python version number
  1. Upon successful installation, Python scripts or commands should now work without the error message Python was not found; run without arguments.

Reason 2

Python is not added to your system’s PATH – Even with Python installed on your computer, the system may be unable to locate the Python interpreter if the Python system’s PATH environment variable isn’t added. It is possible to add Python to your PATH by modifying the environment variables on your computer.

Solution:

If Python is installed, ensure that it is added to your system’s PATH environment variable. To do this, go to the Control Panel > System and Security > System > Advanced system settings > Environment Variables

Environment Variables. 

In the System Variables section, find the Path variable, and click Edit

Edit Variables

If the path to the Python installation directory is not present, add it to the list of paths and click OK to save changes.

Python installation directory is not present

Reason 3

Conflict due to App installers for Python – Conflicts can arise due to Python app installers, that prevent Windows from detecting the language correctly.

Solution:

You can use the Check App Execution Aliases feature on the Windows operating system to resolve the Python was not found; run without arguments error. Here are the steps to follow:

  1. Press the Windows key + I to open the Settings app.
Press the Windows key + I to open the Settings app.
  1. Click on Apps and then click on Apps & features.
Apps & features.
  1. Click on App Execution Aliases.
App Execution Aliases
  1. Scroll down and find the entry for Python. If there are multiple versions of Python installed, you may see multiple entries. Make sure the Disabled checkbox is selected for each Python entry.
Disabled checkbox

Disable the App installers for python.exe and python3.exe as shown above and Restart your PC.

Reason 4

The Python interpreter is not located in the default location – The system may not be able to find the Python interpreter if it has been installed in a non-default location. The Python interpreter path can be specified when running the script or command.

Solution:

If the Python installation directory is not in the default location, specify the path to the Python interpreter when running the script or command. For example, if Python is installed in C:\Python38, you can run a Python script using the command C:\Python38\python.exe script.py. Replace script.py with the name of your Python script.

Reason 5

The Python installation is corrupted – Your system may have difficulty finding the Python interpreter if your Python installation is corrupted or incomplete. 

Solution:

If the Python installation is corrupted or incomplete, try reinstalling Python to resolve the issue.

Reason 6

There is a typo in the command or script – If there is a mistake or typo in the command or script used to execute Python. 

Solution:

Double-check the command or script for any errors or typos. Ensure that you have entered the correct path to the Python interpreter and that the script is written correctly.

Conclusion

In conclusion, despite the popularity of the Python programming language, developers of all levels may encounter errors when working with it. One such error message is Python Was Not Found Run Without Arguments which can arise due to a variety of reasons such as Python not being installed or added to the system’s PATH, conflict due to App installers for Python, a corrupted Python installation, or a typo in the command or script.

However, by following the practical solutions outlined in this article, you can overcome this error and run Python scripts or commands smoothly. With the help of this guide, you’ll be able to troubleshoot this error and continue building amazing applications, tools, and models using Python.

Good Luck with your Learning !!

Related Topics:

Python Parallel For Loop

Python was not found; run without arguments

How to Modify Python Global Variable inside a Function

Jerry Richard R
Follow me