I type python
into the command line, but the command prompt says that python is not recognized as an internal or external command, operable program, or batch fi
They gave us a script to do this for us already
C:\Users\hUTBER\AppData\Local\Programs\Python\tools\scripts\win_add2path.py
You'll need to make sure that you close and open the cmd
otherwise it won't have the new path there.
If you can't find this script these are the paths that it will add and I had to add manually in the end.
C:\Users\hUTBER\AppData\Local\Programs\Python\Python35
C:\Users\hUTBER\AppData\Local\Programs\Python\Python35\Scripts
Where mine and now python
works in the cmd
You need to add python to your PATH. I could be wrong, but Windows 7 should have the same cmd as Windows 8. Try this in the command line. Using setx
permanently makes changes to you PATH. Note there are no equal signs, and quotes are used.
setx PATH "%PYTHONPATH%;C:\python27"
Set the c:\python27
to the directory of the python version you'd like to run from the typing python
into the command prompt.
Here's one for for office workers using a computer shared by others.
I did put my user path in path and created the PYTHONPATH variables in my computer's PATH variable. Its listed under Environment Variables in Computer Properties -> Advanced Settings in Windows 7.
Example:
C:\Users\randuser\AppData\Local\Programs\Python\Python37
This made it so I could use the command prompt.
Hope this helped.
The video was very useful.
it worked for me
You have to add the python executable in your SYSTEM PATH, do the following, My Computer > Properties > Advanced System Settings > Environment Variables
> Then under system variables I create a new Variable called "PythonPath". In this variable I have "C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk;C:\other-foolder-on-the-path"
.
Even after following the instructions from the valuable answers above, calling python from the command line would open the Microsoft Store and redirect me to a page to download the software.
I discovered this was caused by a 0 Ko python.exe file in AppData\Local\Microsoft\WindowsApps
which was taking precedence over my python executable in my PATH.
Removing this folder from my PATH solved it.