Skip to content

Fix: Python was not found; run without arguments to install 

  • by
  • 4 min read

Python is one of the most popular programming languages of all time. It’s easy to set up and learn and is quite powerful to the extent that you can use it for anything from programming electronics to writing complicated scripts.

That said, just like everything else in programming, there are usually bugs and glitches from time to time that can randomly slow down your workflow. In this article, we’re talking about the “Python was not found; run without arguments to install” error. 


What causes this error?

The error is mainly caused by your operating system (Windows in this case) not being able to detect the Python installation or if the Path variable for Python isn’t set up correctly.

Also read: How to fix the ‘cannot import name markup from jinja2’ error?


How to fix this?

Here are four fixes you can try out. 

Install Python

The most obvious thing first, if you’re assuming your Windows machine comes with Python installed, chances are you’re wrong. Luckily installing Python isn’t too different from installing anything else. 

Just head over to the Python website and download the installer based on your OS architecture (x86 or x64). Once downloaded, run the installer and make sure it sets up the PATH variables correctly. 


Set up the environment variables

Even if Python is installed on your computer if you haven’t set up the environment variables correctly, you’re going to run into problems. Here’s how you can set the correct environment variables for Python.

Step 1: Press Windows Key + R to open the Run prompt. Type sysdm.cpl and hit enter. 

Java virtual machine launcher error: 3 Fixes

Step 2: Head over to the Advanced tab and click Environment Variables. 

Java virtual machine launcher error: 3 Fixes

Step 3: Select Path under User variables and click Edit. 

Step 4: Enter the installation paths for Python in the Edit environment variable window. The default Python installation paths for version 3.7 and above are as follows. 

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

Make sure to change the aforementioned file paths according to your Windows user name and your installed Python version. Now restart your computer, and the error should be resolved. 

Also read: How to fix “There was an error checking the latest version of pip”?


Check App Execution Aliases

Sometimes app installers for Python can cause conflicts and make Windows not detect the language properly. Here’s how you can fix this. 

Step 1: Press the Windows key + I to open Windows settings and click on Apps. 

Step 2: Click Apps & features.

Step 3: Click More settings followed by App execution alias. 

Step 4: Find and disable any Python app installers you see.

Restart your PC, and you should be good to go. 


Run a clean install

If nothing else works, your best bet is to uninstall Python from your PC and reinstall it again from scratch. This ensures that any wrong variables or modules that might be installed in the wrong places get removed, and everything else is done from the beginning in the correct order. 

Also read: Error: Legacy-install-failure: 3 Fixes

Yadullah Abidi

Yadullah Abidi

Yadullah is a Computer Science graduate who writes/edits/shoots/codes all things cybersecurity, gaming, and tech hardware. When he's not, he streams himself racing virtual cars. He's been writing and reporting on tech and cybersecurity with websites like Candid.Technology and MakeUseOf since 2018. You can contact him here: yadullahabidi@pm.me.

>