Sorry about the chinese character in this picture. It basicly mean "this is no such program" when I try to run command "python" in powershell。 But it works when I run "python.exe"。 It is quite annoying.
Asked
Active
Viewed 2,682 times
0
-
2did you add the path to your Python installation to the environment variable PATH? – FObersteiner Jan 26 '21 at 16:29
-
1What do you get if you enter `Get-Command Python` ? – pepoluan Jan 26 '21 at 16:46
-
It is clear from your image, that `python.exe`, is not in the root of your `D:` drive, i.e. `D:\python.exe`. The problem is that you have not told your system where to look for the executable file, so it cannot run it. Please do not follow the lazy people's advice to add the full parent path of your `python.exe` file to the PATH environment variable. Either use the fully qualified and absolute path, or define it as a local variable at the beginning of your interactive session. – Compo Jan 26 '21 at 19:03
-
On Windows the installer installs the Python launcher by default. Try "py". – Mark Tolonen Jan 26 '21 at 19:18
2 Answers
0
You probably do not have "python" in your PATH variable. This thread should help you : Python not working in command prompt?

FreightTrain
- 11
- 1
0
Try using the powershell command Start-Process
and then it will ask you for a filepath. You can then type that in and then hit enter and the program should run.
It should look something a little like this:
cmdlet Start-Process at command pipeline position 1
Supply values for the following parameters:
FilePath: C:\Users\YOURUSERNAME\documents\spiralgram.py
Just make sure you replace that filepath with your path to python.exe.

Carter Mihan
- 3
- 1