What is PIP?
Pip Installs Package, PIP, is a package management system responsible for installing and managing software packages written in Python. A common use of PIP is to handle packages found in the Python Package Index.
In order to run any PIP command through the Windows Command Prompt, it must know the location of the PIP installation directory. System’s failure to find an executable PIP command will result in ‘pip’ is not recognized as an internal or external command error.
From the numerous user complaints, it is evident that the error is not specific to a certain version of the OS. It has been reported on Windows 7, Windows 8 and Windows 10.
What causes this error?
After a thorough understanding of user complaints, we see that there are several instances that trigger this particular error. The two main reasons are:
- PIP installation is not added to system variable. To successfully run PIP commands through the Command Prompt you need to add and manually configure the PIP path.
- Incorrect system path added – Multiple versions of Python can mix up the installation path. Syntactical errors such as additional spaces and semicolons can also produce errors.
Solutions to the “pip is not recognized as an internal or external command” error
1. Check if PIP is added to the PATH variable
Before getting into the solutions to the problem, let’s try and find out more about the issue at hand. If you are unsure about the existence of PIP on the path, you can find out through the following steps.
- Press the Windows key + R at the same time, then type “cmd” into the Run window to open up a Windows Command Prompt.
- Once the Command Prompt has opened, type in “echo %PATH%” and press Enter. This step will display a list of all the locations added to the PATH variable.
- Now from the listing, search for something similar to C:\Python37\Scripts, this could be different depending on the version of Python installed on your PC. If you find something similar to the path mentioned above, it means that the installation path has already been added to the PATH variable.
NOTE: To check your Python version, run the following command: python –version
- If you were not able to find the path, continue reading the methods below to add PIP to the PATH.
2. Add PIP to the path environmental variable using Python executable installer.
This method is the simplest and safest way to install or fix Python and the PIP path variable.
- Run the following command to check the Python version installed: python –version.
- Download the same version of executable installer from Python.org.
- Once downloaded, run the Python setup and select the Modify button during setup.
- On the next window, ensure that the pip option is ticked and click on Next.
- When the Advanced Options window appears, ensure that the Add Python to the environment variables is ticked. Then click on Install.
3. Add PIP to the PATH environment variable using Windows CMD.
The easiest way to add PIP is through the Windows Command Prompt. This method will save you time. However, this method is only applicable if the correct path of PIP is known.
- Press the Windows key + R simultaneously and search for “cmd “to open up the Windows Command Prompt.
- Now type and run the following command: setx PATH “%PATH%;C:\Python37\Scripts”
NOTE: If your Python is installed in a custom location, change the command accordingly.
- Now, to check if the error has been resolved. From the command window, try running any PIP command.
4. Add PIP to the PATH environment variable using the Windows GUI.
Below are the steps the add PIP to the Windows environment variable:
- Open system properties: Press Windows key and search for This PC.
- Right-click on This PC and select Properties.
- Click on Advanced system settings.
- Click on Environment Variables on the bottom left.
- Select the variable Path and click on Edit.
- Click on New to add PIP path to Windows Environment Variables.
- Type in: C:\Python38-32;C:\WINDOWS;C:\Python37\Scripts
- Click OK to save the changes.
NOTE: If Python is installed in a custom location, change the path accordingly. Replace the location with the appropriate one based on your Python version and installation folder.