If you are a Python programmer, you know the importance of its libraries. One of the easiest ways to install those libraries is by using the PIP command. However, when some users tried doing the same, they encountered the following error message: ‘pip’ is not recognized as an internal or external command.
In this post, we will discuss this issue and see what you can do if you encounter a “PIP is not recognized as an internal or external command” error.
Why is pip not recognized in CMD?
If the Python package is not added to the Environmental Variable, PiP, which is found in Python Package Index, will not be recognized. When installing the package, users are asked to give permission to add Python to the environmental variable, some of them, skip this and then have to do it manually. In this post, we have mentioned every single solution you need to resolve this issue.
Fix PIP is not recognized as an internal or external command
If you see PIP is not recognized as an internal or external command follow the solutions mentioned in this post to resolve the issue.
- Add Python to the environmental variable
- Run the Python Installation Package and tick the PiP box
- Reinstall Python
Let us talk about them in detail.
1] Add Python to the environmental variable
More often than not, this issue is caused due to the fact that Python is not added to the environmental variable. In that case, you can manually add it to the environmental variable and see if the issue is resolved. There are two methods to do the same, you can either use configure the Environmental Variable from System Properties or Command Prompt.
First of all, we will be trying to do the same using the System Properties, so, follow the prescribed steps to do the same.
- Hit Win + S, type “Environmental Variable” and hit Enter.
- Ensure you are on the Advanced tab and click on the Environmental Variables.
- Select Path and click on Edit.
- If you can’t find any path related to Python, click on New, paste C:\Python34\Scripts, and click Ok.
Note: Python34 means Python 3.4, if you have another version, write accordingly.
Hopefully, this will do the job for you.
In case you want to configure the Environmental Variables using Command Prompt, first of all, execute the following commands.
- To check if Python is present in Environmental Variables.
- If you can’t find a path similar to C:\Python34\Scripts, run the following command.
setx PATH “%PATH%;C:\Python37\Scripts”
Hopefully, this will do the job for you.
Related: How to open and view Python PY files on Windows
2] Run the Python Installation Package and tick the PiP box
When installing Python, you may have noticed, it asks you for permission to install some services including PiP. Most of us tend to grant permission, but some don’t. If you are one of them, you won’t be able to install Python libraries using PiP. That is why we ask you to run the installation package again and then tick the box associated with PiP. Follow the prescribed steps to do the same.
- Open Settings.
- Go to Apps > Installed apps or Apps & features.
- Search for Python.
- Select Modify.
> Windows 11: Click on the three vertical dots and then select Modify or Change.
> Windows 10: Select the app and then click on Modify or Change.
- Click on Modify when prompted.
- Tick the box next to the pip.
- Click on Next.
- Tick the box next to Add Python to environmental variables.
- Click Install.
Hopefully, this will do the job.
3] Reinstall Python
If nothing works, your last option is to reinstall Python. However, this time be more careful when installing the language. So, go ahead and uninstall Python, next download the installation package from python.org, and install it correctly.
Hopefully, you are able to resolve the issue using these solutions.
Read: How to install NumPy using PIP on Windows
How do you fix PiP is not recognized as an internal or external command?
If PiP is not recognized as an internal or external command, follow the solutions mentioned in this post to resolve the issue. Usually, the issue is caused if the required package is not added to the Environmental Variables. We have tried giving you all the possible ways to add PiP to environmental variables. So, follow them and you will be good to go.
Also Read: Fix Command python setup.py egg_info failed with error code 1.