Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python is not recognized windows 10

I recently installed Python 3.6.3 on my device. When I type python in my cmd, it gives me this error. I do have the PATH in the environment variables. Path Lists. This should normally fix it but python is still not recognized.

like image 931
Rishabh Mandayam Avatar asked Nov 28 '17 19:11

Rishabh Mandayam


People also ask

How do you fix Python is not recognized Windows 10?

Specify the full location to python.exe You learned previously that this error occurs when Windows can't find the location of the Python executable file. One way to fix the error would be to launch Python from the Command Prompt by passing in the full path to the executable file each time you wanted to run Python.

Why does my computer not recognize Python?

The “Python is not recognized as an internal or external command” error is encountered in the command prompt of Windows. The error is caused when Python's executable file is not found in an environment variable as a result of the Python command in the Windows command prompt.


1 Answers

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 as pip

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.

like image 114
Brian M. Sheldon Avatar answered Oct 16 '22 20:10

Brian M. Sheldon