Python is not recognized as an Internal or External Command is a common problem or issue, most of the newbies faced when the first time install Python in their system.
But you guys don’t need to worry as the quote says, “Every Expert was once a Beginner”.
So in this article, we are covering two ways or methods to solve the problem.
Why the Error Python is Not Recognized as an Internal or External Command occurs?
This error means that your Windows don’t know about Python existence on ur machine. This happens because the cmd searches through certain files in predefined locations for the command you entered. Those certain locations are stored in a global (environmental) variable on ur machine called PATH. So you need to add your Python directory to the PATH variable.
So, we can say, this error occurs when the user does not specify the full path of python distribution.
How to Solve Python is Not Recognized as an Internal or External Command
We can solve error using two ways.
- Adding Python PATH to Environmental Variable in Windows
- Adding Python PATH to Windows Environmental at the time of installation.
1. How to add Python to Windows Environmental Variables PATH Manually
In case, if you want to utilize Python without defining the full path, then you need to add Python to the Windows Path manually.
Note that I’ll be using Windows 10 to demonstrate the steps, but similar principles would apply for previous versions of Windows.
- Right-click on this PC and Select Properties.
2. Inside ‘Property’ window select ‘Advanced system settings’
3. Now go to Environment Variables button at the bottom (here we will add the full path of python distribution).
That will take you to the Environment Variables screen, where you can add new paths.
4. In the System variable window, find the Path variable and press Edit:
5. Select the New button and add Python’s path at the end of the list. Keep in mind that you can separate multiple paths by semicolons.
This is how my Variable value would look like:
C:\Users\PythonPool\AppData\Local\Programs\Python\Python37-32
Here Change PythonPool with your username.
Press ‘OK’ and you would then see your new Python Path under the ‘User variables’ section. Don’t forget to press ‘OK’ again so that the changes will get implemented.
That’s it! You just added Python to the Windows Path.
2. Adding Python PATH to Windows Environmental at the time of installation.
If you’re sure you installed Python and you get this particular error, here’s what went wrong: you forgot to add Python to the PATH variable during the installation process.
You can easily add Python to the Windows path by installing a recent version of Python and then check the box to Add Python to PATH during the installation.
Before you proceed, you may choose to uninstall your previous version of Python if needed.
In my case, the latest version of Python that was available to install was version 3.8.1.
So, get the Latest Version According to your System configuration.
After that, in the Python installation box, just check the box to add Python 3.8 to PATH.
PS: In some version, of Windows 10 instead of python py is working.
That’s It, Finish the installation, and you should be good to go.
Congratulations, you can now run Python from the command prompt and PowerShell.
Must Read: How Long Does It Take To Learn Python
Conclusion
Therefore, we detailed how to fix the error Python is Not Recognized as an Internal or External Command and install Python on Windows. If you are installing a different version of Python, you can expect a similar process.
Remember, choose your version carefully, make sure that you have Pip installed, and use virtual environments when developing multiple projects on a single system.
If you are still facing some issue do let us know in the comment section below.
Happy coding!
I’ve done this, and I still get the same error.
Can you tell me what the exact error you are facing is?
Thanks. Yes, on the cmd I get phyton is not recognize…Howver, upon following your steps, I can see is added in the path in both the top and the bottom options