0

I'm on Windows 10 and have Python 3.9.0 installed. The evinronment variables I have for Python are C:\Users\Zimplfy\AppData\Local\Programs\Python\Python39\ and C:\Users\Zimplfy\AppData\Local\Programs\Python\Python39\scripts\ in PATH. For some reason whenever I type py inside Command Prompt I get:

'py' is not recognized as an internal or external command, operable program or batch file.

But when I type in python I get:

Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

Anyone have an answer to why this could be?

Thanks in advance.

user1239856
  • 1
  • 1
  • 1
  • 2
  • 1
    Please provide your environment PATH variable that contains the directory for Python. Please **edit** your question instead of submitting a comment – Ramhound Nov 11 '20 at 21:15
  • `py` is a separate program and must be selected during the Python installation process (assuming you are using vanilla Python from [Python.org](https://www.python.org/)). If you are using another distribution of Python (e.g. Anaconda), this program may or may not be included. – Anaksunaman Nov 11 '20 at 21:33

2 Answers2

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.

Yomie
  • 11
  • 1
0

you can fix it by checking

> where py

for example on my machine the output is

C:\Windows\py.exe

so if the py is missing and you have standard python installation then you need need to make sure that C:\WINDOWS is in the path by setting env path WINDIR=C:\WINDOWS

verify

echo %WINDIR%

if there is still no py.exe then reinstall python

lww
  • 101
  • 2