python is not recognized windows 10
you get this error because the python.exe path has not been added to the System environment variable to do that simply
go to the path
C:\Users\%Username%\AppData\Local\Programs\Python\Python37-32
which contains python.execopy the path and open system environment variables and in the variable section look for variable called Path if not create new variable with Variable Name as Path and value as the copied path
- once you do that close the window and simply open cmd and type python you should get something like this
If still not working, as mentioned above in the answers, then simply move up the path, as shown in the screenshot.
I had the same problem, due to a stupid decision from Microsoft.
I had another line in my system path variable:
C:\Users\MyUserName\AppData\Local\Microsoft\WindowsApps
And windows 10 put there a python.exe
file that only redirected me to the python page of the Microsoft Store:
Since this line was above my true python path, typing python
in the cmd prompt opened the Microsoft Store...
Solution:
Type App execution aliases
in the windows 10 search bar, then uncheck the aliases for python.exe
and python3.exe
. More information here
The path to the python executable needs to be in the System PATH variable. Note this is not the User PATH variable.
The OP had Python 3.6.3 installed in C:\Python\Python36-32
, however
a common default location for installation is in the users AppData\Local\Programs\
folder. This post will assume a Python 3.10 installation in this location. Please adjust as needed for your current python version and path.
You can confirm the path from the command prompt by checking python directly from the folder.
cd %LOCALAPPDATA%\Programs\Python\Python310
python --version
This should print the python version. For example Python 3.10.4
.
Add the following entries to the System PATH:
%LOCALAPPDATA%\Programs\Python\Python310
for the python executable%LOCALAPPDATA%\Programs\Python\Python310\Scripts
for tools such aspip
After adding the path to the System PATH variable, make sure you close and re-open any command prompts so they use the updated PATH.