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

Question:

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?

Asked By: mathisfuniguess

||

Answers:

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>Python311Scripts

E.g.:
C:Users<User>AppDataLocalProgramsPythonPython311
C:Users<User>AppDataLocalProgramsPythonPython311Scripts
  • If you are creating new PATH variable, add the following line:
<Your python installation path>Python311;<Your python installation path>Python311Scripts

E.g.:
C:Users<User>AppDataLocalProgramsPythonPython311;C:Users<User>AppDataLocalProgramsPythonPython311Scripts

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

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

Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.