0
votes

I have Python on my PATH but when I run the command prompt python --version I got:

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

Any help with Windows would be appreciated...

3
What does py --version say? - Mustafa Aydın
Python 3.x might be aliased to python3 depending on your installation process - Lukas Thaler
@MustafaAydın I don't even know what that means sorry. My ADMIN installed Python from the website and clicked add to PATH for me... - delalma
I meant can you run py --version command instead of python --version. - Mustafa Aydın
From where you downloaded the python. Microsoft Store or from their website - Rishabh Semwal

3 Answers

1
votes

You need to download python from https://www.python.org/. During installation be sure to check the install to path option.

0
votes

I think your cmd prompt path and python path is not in same location.

First check the python location on your PC.

import os
import sys
os.path.dirname(sys.executable)

If it is on D: or another location you have 2 options, you can delete and re-install python to C: or you can open cmd prompt from D: or related python path.

0
votes

Windows has made it easier for non-professionals to install Python as of their 10 May 2019 update. See Who put Python in the Windows 10 May 2019 Update? for more details why this is done. As a result, you get this strange error when you try to run Python, even if you have installed it officially from the official Python download site.

The solution to this problem is perfectly described in this other StackOverflow question.