I try to write 'py' instead of 'python', I'm getting an error. And this is my path:
How to fix 'py' is not recognized as an internal or external command, operable program or batch file
Asked
Active
Viewed 1.0k times
0

TheGeorgeous
- 3,927
- 2
- 20
- 33

Mehmet Karagöz
- 45
- 1
- 2
- 10
-
Does running `doskey py = python` in command line solve the problem? – Rahul Bohare Nov 05 '20 at 12:33
-
I'm getttin an error like this 'doskey' is not recognized as an internal or external command, operable program or batch file. – Mehmet Karagöz Nov 05 '20 at 12:45
-
Add `C:\Windows\System32;` to the **PATH** variable and then try running the command again. You can follow the steps [here](https://superuser.com/questions/988311/doskey-is-not-recognized-when-using-cmder) to edit PATH in more detail. – Rahul Bohare Nov 05 '20 at 12:51
1 Answers
1
Run in the command line:
doskey py = python
This creates an alias for the python
command and then you can use py
to start the python interpreter.
If you get an error regarding doskey
not being recognized as an internal or external command, add C:\Windows\System32;
to the PATH and run the command again. You can follow the more detailed instructions here to modify the PATH.

Rahul Bohare
- 762
- 2
- 11
- 31
-
2This is the wrong way to solve the problem. There is no particularly good reason to alias `py` to `python` arbitrarily; people who write `py` (or suggest to do it) are doing so in order to use the Python Launcher for Windows, **not** to start a Python executable directly. If `py` isn't found, it can only realistically be because it **wasn't installed** - because it is designed to install directly into the Windows folder. – Karl Knechtel Sep 22 '22 at 00:41