Python is not recognized as an internal or external command

When I try to run my python file it shows that Python is not recognized as an internal or external command, yet the environment variable path is also correct it shows the same error and I tried reinstalling the python, still not working.

Sounds like Python is not in your path. Take a look here. Python not found by command prompt - #6 by c-rob

I am going to assume you are a windows user.
If not let us know which operating system you are using.

Try using the py command in place of python.
Also use py -m pip in place of pip command.

There is lots of documentation on using Python on Windows in the docs here 4. Using Python on Windows — Python 3.13.0 documentation

2 Likes

When you type “python” into the command line, the “PATH environment variable” (this is the term you want to google) decides what exact program named “python” gets run. PATH contains a list of folders that the command line checks.

You can use the where command to find out which “python” is run according to the current PATH setting: where python shows you this info. (On Linux/macOS, use the which command instead: which python3)

But yes, on Windows you can use py (which is the C:\Windows\py.exe) program to automatically find a particular version of Python on your computer. (The py program isn’t on Linux/macOS unfortunately.)