Fixes

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.

PIP is not Recognized as an Internal or External Command
PIP is not Recognized as an Internal or External Command

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.

  1. Press “Windows + R” to launch into the Run prompt, type in “Cmd” and press “Shift + CTRL + Enter” to launch with admin permissions.
    Typing in cmd
    Typing in cmd
  2. After that, type in the following command and press “Enter” after it to execute it.
    echo %path%
  3. After executing this command, make sure that you see the following or a similar path in the result.
    C:\Python37\Scripts
  4. 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:

  1. Press “Windows +R” to launch Run, type in “sysdm.cpl” and press “Enter” to launch into the window.
    Typing "sysdm.cpl"
    Typing “sysdm.cpl”
  2. From here, click on the “Advanced” tab from the top and select the “Environment Variables” option at the bottom right.
  3. After that, double-click on the “Path” option under the System Variables” heading and click on the “New” button from the new window.
    Selecting the "Path" option to fix PIP is not Recognized as an Internal or External Command error
    Selecting the “Path” option
  4. 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
  5. 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:

  1. Press “Windows + R” to launch into the Run prompt, type in “cmd” and press “Shift + CTRL + Enter” to launch with admin permissions.
    Typing in cmd
    Typing in cmd
  2. After that, execute the following command to add PIP to the Path Environment Variable.
    setx PATH “%PATH%;C:\Python37\Scripts”
  3. If you are on a Linux, open the terminal and execute the following commands.
    PATH=$PATH:<PYTHON_HOME>\Scripts
    
    Export PATH
  4. 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:

    1. Press “Windows + R” to launch the Run prompt, type in “cmd” and press “Shift + Ctrl + Enter” to launch with admin permissions.
      Typing in cmd
      Typing in cmd
    2. After that, execute the following command but replace the “[Packagename]” part with the actual name of the package.
      python -m pip install [packagename]
    3. Open up an elevated Command Prompt, type in the following command and press enter

Method 2:

    1. Inside the admin command prompt, type in the following command and press “Enter” to execute it.
      cd C:\python installs
    2. This will help us find the “Python .whl” file and where it is located.
    3. 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
    4. Check to see if this fixes the PIP is not recognized as an internal or external command issue.

Method 3: Installing PIP with Python Installation

  1. Press “Windows + R” to launch into the Run prompt, type in “appwiz.cpl” and press the “Enter” key from your keyboard.
    Typing in "Appwiz.cpl" and pressing "Enter"
    Typing in “Appwiz.cpl” and pressing “Enter”
  2. From here, right-click on the “Python” app listed inside the window and select the “Change” button.
  3. From the new window, select the “Modify” button and make sure that from the Optional Features menu, you select “PIP”.
  4. Click on Next after selecting PIP and select the “Install” button.
  5. Wait for it to be installed and check to see if the issue is fixed

Method 4. Installing Python using the Executable Installer

  1. Press “Windows + R” to launch into the Run prompt, type in “appwiz.cpl” and press the “Enter” key from your keyboard.
    Typing "appwiz.cpl"
    Typing “appwiz.cpl”
  2. From the list of apps installed, right-click on the “Python” app and select the “Uninstall” button.
  3. After it is uninstalled, go to this link and download the executable that is appropriate for your computer.
  4. After downloading, run the executable and make sure to select the “Add Python 3.7 to Path” option has been selected.
  5. After that, select the “Customize Installation” option.
  6. From the Optional Features, select “PIP” and from “Advanced” settings, select the “Add Python to Environment Variable” option and then select the “Install” button.
  7. 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.
  8. If not, try to execute the following command in an admin command prompt.
    python -m ensurepip --default-pip
  9. 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

  1. Press “Windows + X” on your keyboard to launch the menu and select “PowerShell Admin” from the list.
    Clicking on the "Windows Powershell Admin" option
    Clicking on the “Windows Powershell Admin” option
  2. After that, execute the following command inside PowerShell and replace the paths with your own.
    [Environment]: :SetEnvironmentVariable(“Path”,”$env:Path;C:\Python27\Scripts”,”User”)
  3. 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.

Alan Adams

Alan is a hardcore tech enthusiast that lives and breathes tech. When he is not indulged in playing the latest video games, he helps users with technical problems that they might run into. Alan is a Computer Science Graduate with a Masters in Data Science.
Back to top button