Easily Fix PIP is not Recognized as an Internal or External Command
If you are getting the “PIP is not Recognized as an Internal or External Command” error while executing the PIP command in cmd, we recommend that you go through this article. This is because most of the time the command is triggered because Python hasn’t been added to the Environment Variable on your computer which is an important step towards getting the computer to recognize your commands.
Method 1: Adding PIP to Path Variable
First of all, we must check to verify if PIP hasn’t already been added to the path variable, for that, we can use the following process.
- Press “Windows + R” to launch into the Run prompt, type in “Cmd” and press “Shift + CTRL + Enter” to launch with admin permissions.
- After that, type in the following command and press “Enter” after it to execute it.
echo %path%
- After executing this command, make sure that you see the following or a similar path in the result.
C:\Python37\Scripts
- If the path is visible, it means that PIP has already been added to the path Variable but if it isn’t, you will have to follow the steps that we have listed below.
You can use these Steps to add PIP to the Path Environment Variable:
- Press “Windows +R” to launch Run, type in “sysdm.cpl” and press “Enter” to launch into the window.
- From here, click on the “Advanced” tab from the top and select the “Environment Variables” option at the bottom right.
- After that, double-click on the “Path” option under the “System Variables” heading and click on the “New” button from the new window.
- After selecting the new button, make sure to type in the path where PIP has been installed. By default, it should look something like the following.
C:\Python34\Scripts
- After you are done, click on “OK” and check to see if the error has been fixed.
Alternatively, you can also add PIP to the Environment Variable using the command prompt. For that:
- Press “Windows + R” to launch into the Run prompt, type in “cmd” and press “Shift + CTRL + Enter” to launch with admin permissions.
- After that, execute the following command to add PIP to the Path Environment Variable.
setx PATH “%PATH%;C:\Python37\Scripts”
- If you are on a Linux, open the terminal and execute the following commands.
PATH=$PATH:<PYTHON_HOME>\Scripts Export PATH
- Check to see if the ‘PIP’ is not Recognized as an internal or external command error is fixed after completing these steps.
Method 2: Running Python without PIP Variable
The Python Package can be installed from the command prompt without having to use the PIP variable. For that, you can use any of the methods that we have listed below.
Method 1:
-
- Press “Windows + R” to launch the Run prompt, type in “cmd” and press “Shift + Ctrl + Enter” to launch with admin permissions.
- After that, execute the following command but replace the “[Packagename]” part with the actual name of the package.
python -m pip install [packagename]
- Open up an elevated Command Prompt, type in the following command and press enter
Method 2:
-
- Inside the admin command prompt, type in the following command and press “Enter” to execute it.
cd C:\python installs
- This will help us find the “Python .whl” file and where it is located.
- After that, execute the following command and replace the “[Package].whl” with the location of your package that we found.
c:\python37\scripts\pip.exe install [package].whl
- Check to see if this fixes the PIP is not recognized as an internal or external command issue.
- Inside the admin command prompt, type in the following command and press “Enter” to execute it.
Method 3: Installing PIP with Python Installation
- Press “Windows + R” to launch into the Run prompt, type in “appwiz.cpl” and press the “Enter” key from your keyboard.
- From here, right-click on the “Python” app listed inside the window and select the “Change” button.
- From the new window, select the “Modify” button and make sure that from the Optional Features menu, you select “PIP”.
- Click on Next after selecting PIP and select the “Install” button.
- Wait for it to be installed and check to see if the issue is fixed
Method 4. Installing Python using the Executable Installer
- Press “Windows + R” to launch into the Run prompt, type in “appwiz.cpl” and press the “Enter” key from your keyboard.
- From the list of apps installed, right-click on the “Python” app and select the “Uninstall” button.
- After it is uninstalled, go to this link and download the executable that is appropriate for your computer.
- After downloading, run the executable and make sure to select the “Add Python 3.7 to Path” option has been selected.
- After that, select the “Customize Installation” option.
- From the Optional Features, select “PIP” and from “Advanced” settings, select the “Add Python to Environment Variable” option and then select the “Install” button.
- After completing the installation, restart your computer and check to see if the “PIP is not recognized as an internal or external command” error is fixed.
- If not, try to execute the following command in an admin command prompt.
python -m ensurepip --default-pip
- Check to see if the PIP is not recognized issue is now fixed.
Method 5: Using the py -m Command
In case you have the PIP and Py installed but you would not like to use the Path, you can execute PIP as your command by using the “py -m” as your prefix to the command. For that, the command would look like:
py -m <Command> or py -m pip...
Method 6: Using Windows PowerShell
- Press “Windows + X” on your keyboard to launch the menu and select “PowerShell Admin” from the list.
- After that, execute the following command inside PowerShell and replace the paths with your own.
[Environment]: :SetEnvironmentVariable(“Path”,”$env:Path;C:\Python27\Scripts”,”User”)
- Check to see if doing so fixes the PIP is not recognized as an internal or external command error.
If the issue still occurs on your computer, we recommend you contact us for further troubleshooting.