I was trying to download a GUI, but the terminal kept giving me 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.

I'm trying to install it using this command:

python -m pip install --upgrade pip setuptools virtualenv

Peter Mortensen's user avatar

asked Dec 17, 2020 at 21:55

Joseph Haywood's user avatar

Joseph HaywoodJoseph Haywood

2,5032 gold badges7 silver badges4 bronze badges

8

  1. Check your Python version and be sure it is installed on your machine

  2. Check the path environment variable

  3. Go to -> "start" and type "Manage App Execution Aliases". Go to it and turn off "Python"

screenshot

Christoph Rackwitz's user avatar

answered Feb 28, 2021 at 13:58

janadari ekanayaka's user avatar

11

I was having the same issue and I fixed it by using the below method.

  1. Copy two paths of Python
%AppData%\Programs\Python\Python311
%AppData%\Programs\Python\Python311\Scripts

These are the paths where your Python interpreter is installed. Now add this path into your environmental variable. Put this path into System variable, not in user variable. I was using user variable, so I was facing the issue.

Screenshot for Environment Variables window

Gangula's user avatar

Gangula

7,3725 gold badges50 silver badges87 bronze badges

answered Dec 29, 2020 at 18:12

Maninder's user avatar

ManinderManinder

1,9191 gold badge13 silver badges13 bronze badges

8

I have a solution for you. Make sure you check the path mark during installation. Then you need to go to Manage App Execution Aliases.

Simply go to your search bar and search for Manage App Execution Aliases. You will find the attached screen and you need to turn off App Installers as you see on the screen. Also, see the path,,, follow Maninder's answer.

enter image description here

Then you are good to go! :)

Abel's user avatar

Abel

57.2k25 gold badges157 silver badges260 bronze badges

answered Jul 1, 2021 at 19:15

Md Forhad Sarkar's user avatar

Md Forhad SarkarMd Forhad Sarkar

1,6681 gold badge13 silver badges12 bronze badges

7

I had the same issue. In Windows CMD, only: py --version, works.

I tried adding the path on System variables, and it didn't work. If you are using PyCharm as I do, try to run all commands from the IDE's terminal. It usually is on the side bar where the Run and the Console is. If it is not, go to: menu ViewTool WindowsTerminal. It worked just fine for me.

Peter Mortensen's user avatar

answered Dec 29, 2020 at 19:37

Strato P.'s user avatar

Strato P.Strato P.

6794 silver badges2 bronze badges

1

You need to download Python from https://python.org. When in the installation, be sure to check the option that adds Python to PATH.

Peter Mortensen's user avatar

answered Dec 17, 2020 at 22:23

DeeDeeAich's user avatar

DeeDeeAichDeeDeeAich

5841 gold badge4 silver badges9 bronze badges

7

I haven't gotten this error before and have been using Python a long time, and then suddenly it showed up. I think that it is a result of a Windows update designed to steer you to their store.

In any case: to remedy the problem, go to Settingsapp execution aliases → and turn "off" Python. (What they tell you to do, in other words). This should resolve the problem.

Peter Mortensen's user avatar

answered Dec 18, 2020 at 23:48

Anthony Curtis Adler's user avatar

0

I solved this problem for Visual Studio Code with just writing "python" in the console:

python

After that, Microsoft Store opens automatically with the Python app:

Enter image description here

And I just click Get.

And it all work!

Peter Mortensen's user avatar

answered Jun 4, 2022 at 10:20

KomarCorporation's user avatar

3

There could be an alias of Python, such as: "py", or "python3". For me, it was solved just by typing "py".

answered Mar 26, 2023 at 20:48

Iyad's user avatar

IyadIyad

991 silver badge6 bronze badges

3

All the previous answers are correct, but in my case, I was getting this, because I was not passing the version...

The fix is passing the version:

py.exe -3 your_program

Peter Mortensen's user avatar

answered May 20, 2022 at 19:02

grepit's user avatar

grepitgrepit

22.4k6 gold badges108 silver badges82 bronze badges

To check in Windows

py --version

Or restart your PC first, and then use this command again.

Peter Mortensen's user avatar

answered Feb 2, 2023 at 6:52

Md Wahiduzzaman Emon's user avatar

If you have installed Python successfully with add python path, ticked on, and have added

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

to the path into System variables and have turned off the "aliases" and they all didn't work, you can simply use python instead of python3 in your cmd command.

Peter Mortensen's user avatar

answered Jun 30, 2021 at 5:11

Farhang Amaji's user avatar

4

Check the Aliases for App Execution in Windows. Search for Alias App in your Windows toolbar to find the UI for this. Try turning off anything Python related.

Peter Mortensen's user avatar

answered Apr 6, 2021 at 13:08

Bernard Finucane's user avatar

1

The same thing happened to me even after trying all the above-mentioned steps. I just restart my system and it was working fine. Do it and if still doesn't fix the issue then make sure you have checked "add python ( any version ) to PATH" before installing Python.

Check the option that has to be selected before installing

answered Dec 8, 2021 at 18:26

Amit kumar's user avatar

1

I faced the same error while using Anaconda and trying to link the Python executable path in the command prompt.

It got rectified by going to SettingsApp execution aliases → and turning "off" Python. Then again I had to set the path for Python in Anaconda and was successful in executing "python --version" command.

Peter Mortensen's user avatar

answered Feb 10, 2021 at 21:13

Ruby's user avatar

RubyRuby

2012 silver badges2 bronze badges

Try adding the following to your "Path" environment variable:

C:\Users\Default\AppData\Local\Programs\Python\Python37
C:\Users\Default\AppData\Local\Programs\Python\Python37\Scripts

Replace Python37 with your own version.

Editing Path in the Environment Variables

Peter Mortensen's user avatar

answered Jun 8, 2022 at 12:52

Ranch Camal's user avatar

Ranch CamalRanch Camal

5701 gold badge4 silver badges12 bronze badges

If you're on Windows, you may want to use the Python installer, in Windows Marketplace.

answered Dec 17, 2020 at 22:22

Sean's user avatar

2

None of the answers here worked for me. I did this and the error went away.

For Windows 11 which I was using, I reran the python-3.10.5-amd64.exe file from my downloads directory and then chose to modify the installation.

Then I followed these easy steps.

  1. Make sure the PIP component is checked before proceeding to install.

  2. Then check 'Add Python to environment variables' if it's not checked already.

  3. Proceed to Install.

    At this point, your error will be solved

Peter Mortensen's user avatar

answered Jul 22, 2022 at 11:25

N Jedidiah's user avatar

N JedidiahN Jedidiah

1,8031 gold badge12 silver badges12 bronze badges

To sincerely resolve this issue, do the following:

  1. Uninstall the Python instance and reinstall it. Note: Make sure you check "Add variable PATH".

  2. On the command line, type:

     python -m pip install --upgrade pip setuptools virtualenv
    

Peter Mortensen's user avatar

answered Aug 27, 2021 at 3:17

Okwo moses's user avatar

I was also facing this issue after installing Python, while running the command python --version in the command prompt. Thee error was:

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

So, I too added the path in environment variables as shown, and it worked:

Enter image description here

Peter Mortensen's user avatar

answered Feb 21, 2023 at 17:31

Brijesh Ray's user avatar

Brijesh RayBrijesh Ray

1,3032 gold badges16 silver badges15 bronze badges

I got this issue when I used Visual Studio Code as the IDE, and Anaconda as my Python compiler. And you don't need to close the "app alias" in settings, but copy your python.exe to python3.exe in your Anaconda folder.

Peter Mortensen's user avatar

answered Aug 23, 2021 at 11:07

Ray's user avatar

2

That happened to me. So, to fix it, you have to follow the following steps:

  1. Uninstall the Python version you already installed.
  2. Go ahead and open the installation file to reinstall it again.
  3. Before hitting Install Now, make sure to tick the box in front of Add Python to path.
  4. Go ahead and complete the installation procedure as usual. Steps for installing Python

Peter Mortensen's user avatar

answered Mar 2, 2021 at 21:24

Dheyaa Kadhim's user avatar

The problem is more subtle than it seems.

For example, if you are using Visual Studio Code on the bottom left, you should see Python X.X.X xx-bit (the X is the version).

If you click in there you will see where the IDE is getting the python.exe from.

Locate that folder into your file explorer and then just follow the answer that is saying to change the environments variables.

So copy the path where python.exe is and add it to the Path variable and do the same where the Script folder is (it is in the same directory where the python.exe is).

Then of course make sure your IDE is using the right Python.

Peter Mortensen's user avatar

answered Aug 27, 2021 at 10:21

Alessandro Cinque's user avatar

If none of the previous answers are working, you can check if you have the Python executable in your program files.

Go to C:\Program Files and check if you have the Python application. If not, go to the python download website here and download the .exe file.

While installing you must select "Custom install" and select the location as C:/Program Files.

Install it and it should work now from anywhere. This worked for me!

Peter Mortensen's user avatar

answered Jun 9, 2021 at 8:46

Tanmoy Chowdhury's user avatar

1

If you already have the Python executable on your machine and you are getting this error in Windows 10, search for the Python executable and copy its path then copy the path in system variables. It worked for me.

Peter Mortensen's user avatar

answered Sep 3, 2022 at 5:11

Michael Njuguna's user avatar

I see some resolutions people provided here are a bit complicated.

Here is the simpler way to install pip on Windows or whatever OS. Here is an example for Windows.

  1. go to https://bootstrap.pypa.io/get-pip.py, right-click (or Ctrl + S), and choose the Save as option, and save it in the location you want to execute to file.

  2. assume you saved it in the c/Users/Documents/get-pip.py file, and then just redirect to that file path.

  3. in the c/Users/Documents/, run python get-pip.py

  4. verify the installed pip using pip --version

Peter Mortensen's user avatar

answered Mar 25, 2023 at 10:31

frankiie's user avatar

frankiiefrankiie

4981 gold badge6 silver badges23 bronze badges

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.