Home > database >  "python" in command prompt doesn't work (windows 10)
"python" in command prompt doesn't work (windows 10)

Time:12-06

I downloaded python 1.11 from the python website but whenever I try to launch "python" in command prompt it launches the windows store and tells me to install python.

I ran py -3 and it launches python 3.11 in the command prompt. Is this the only way to access python though why doesn't "python" work?

CodePudding user response:

You need to add python to Windows PATH.
Try using windows search and search for Edit the system environment variables, and then click on Environment variables. You will see "User variables" and "System variables". Find PATH variable in both sections. If you cannot find it, Click "New...".

  • If you are editing existing PATH, add these 2 lines:
<Your python installation path>\Python311
<Your python installation path>\Python311\Scripts

E.g.:
C:\Users\<User>\AppData\Local\Programs\Python\Python311
C:\Users\<User>\AppData\Local\Programs\Python\Python311\Scripts
  • If you are creating new PATH variable, add the following line:
<Your python installation path>\Python311;<Your python installation path>\Python311\Scripts

E.g.:
C:\Users\<User>\AppData\Local\Programs\Python\Python311;C:\Users\<User>\AppData\Local\Programs\Python\Python311\Scripts

Save the variables and you can access python using python on terminals.

Note: On some windows, PATH is defined as Path.

  • Related