How to fix ‘python’ is not recognized as an internal or external command, operable program or batch file
In this article, you will learn about how to fix ‘python’ is not recognized as an internal or external command, operable program or batch file.
Python is not recognized as an internal or external command is a common error but sometimes it kills a lot of time to recognize this issue. Especially, if you are a beginner or just started to learn python. You may be wondering that you have already installed python on your windows machine and installed the executing file but things are not working for you and you don’t know what to do. Do not need to worry, in this article we will fix this issue. The reason behind this error is that python is not added to the path variable and to fix this problem you may follow these approaches.
Approach One:
In this approach, let me assume that you have already downloaded python on your local machine. You can set the full path variable of python at the moment you install it. To do so, see the below image:
3. You should see “Application” under “Type”:
4. Right-click again and choose “Properties”. Copy the “Location” path.
Step 2: Add to the PATH Environment Variables
1. From the system search icon, type “environment variables”. Click and open the result.
2. You’ll see your variables here. Select the PATH variable and click the “Edit” button.
3. In the following window, click “New” and paste the path you copied in Step 1.
4. Click “OK” to save.
Find Your Bootcamp Match
- Career Karma matches you with top tech bootcamps
- Access exclusive scholarships and prep courses
Select your interest
First name
Last name
Email
Phone number
By continuing you agree to our Terms of Service and Privacy Policy, and you consent to receive offers and opportunities from Career Karma by telephone, text message, and email.
If you have an older Windows version (such as Windows 7):
- From the Start Menu, right-click My Computer (could also be My PC or File Explorer).
- Select Advanced System Settings.
- In the Advanced Tab, Click on the Environmental Variables button.
- Find
“Path” in the System Variables list and select “New”.
- Finally, paste the path you copied earlier in Step 1. If your system has lots of paths linked by semicolons, append the path by prefacing it with a semi-colon also.
- Click “OK” to save.
Try running Python again at the command prompt. Remember you may have to close and reopen the command prompt for the changes to work.
Alternative Options
You could also try type in “py” instead of “python”.
This should let you use Python without returning the error message. But if you want to be able to use the full word in your code — “python” — then follow the steps above.
If you are downloading a recent version of Python, there may already be an option that will automatically add Python to the system path so that you don’t have to. Look for “Add to Environmental Variables” and check it.
Conclusion
In summary, if this error message appears even if you know you installed python, it’s very likely it’s an environment variable issue. Just follow the steps above and try again. If you find it too complicated, you can also just reinstall Python and carefully check that you opt for the “Add to Environmental Variables” option.
Bugs and system discrepancies can often be fixed by installing the latest version of both your operating system and the application/program you’re trying to use. Not everyone has that option, however. For example you may be using a work laptop on which you don’t have certain needed permissions, or an older one you don’t want to part with. Read more about using Python on Windows here. Good Luck!