“Fixing – pip is not recognized as an internal or external command”

Python is a world-renowned general-purpose high-level computer programming language through which you can build programs to perform a huge variety of functions. You can automate processes, perform ML and AI operations, data analysis, develop software, build efficient websites and do much more. Python provides several packages that are just a collection of multiple modules. The package installer for python is known as pip. It is used to install python software packages. Sometimes, while installing python packages, users can get “pip is not recognized as an internal or external command” error. Let us take a look at some ways to fix the pip not recognized error.

pip-is-not-recognized-as-an-internal-or-external-command

Causes of the Error :

Generally, there can be mainly two causes for this error.

  1. The system variable does not have the installed pip. For executing python commands in CMD, a pip installation path is needed to be added to the PATH.
  2. It could be added in an incorrect way in the PATH. A missed semicolon or space character in the PATH can cause an error when manually adding the path.

Fixes

Let us look at some detailed and working solutions if the pip install is not working on your computer system.

Method 1: Verify whether the PATH variable has pip added in it or not

  1. Press the Windows key + R to open the Run dialog box.
  2. Type cmd and press the Enter button.
  3. In the command prompt window, type “echo %PATH%”.
  4. Press Enter button. This will list all the locations in the PATH variable.
  5. Depending on the python version you might find something like “C:\Python39\Scripts”. This means the path is added to the PATH variable.

Method 2: How to add pip to PATH environment variable with windows GUI

  1. Press the Windows key + R to open the Run dialog box.
  2. Type “sysdm.cpl“ and press the Enter button.
  3. Click on Advanced tab then go to Environment Variables. You can find these in the System Properties screen.
  4. Under System Variables, choose the Path and click on Edit.
  5. The Edit environment variable screen will open. Click on New and enter the installation path for pip.

Method 3: How to add pip to path windows 7 using command prompt.

  1. Press the Windows key + R to open the Run dialog box.
  2. Type cmd and press the Enter button.
  3. Execute the “setx PATH “%PATH%; C:\Python39\Scripts“ command. Enter the python version accordingly.

Method 4: Without the addition of the pip variable, opening the python package if pip command not found in Windows

There can be two ways to perform this. We can achieve this through the use of several cmd commands.

Way 1: 
  1. Press the Windows key + R to open the Run dialog box.
  2. Type cmd and press the Enter button.
  3. Type cd C:\python installs in the command prompt. This will take you to the directory with the location of the python .whl file.
  4. Execute the c:\python39\scripts\pip.exe install [package].whl for installing the python package and fix pip not working issue. Enter the python version according to the installed version.
Way 2:
  1. Press the Windows key + R to open the Run dialog box.
  2. Type cmd and press the Enter button.
  3. Now, execute the “python -m pip installs (package name)“ command.

Method 5: Checking if pip is there in the python installation or not

Sometimes many python language installers will not install pip by default. If python is not recognized in cmd then we can fix it by enabling python pip installation.

  1. Press the Windows key + R to open the Run dialog box.
  2. Type “appwiz.cpl” and then press Enter button.
  3. Under the Programs and Features screen, right-click on Python and then click on Change.
  4. Click on Modify option.
  5. Check the pip box in Optional Features and click on Next.
  6. Click on the Install button. This will apply to your changes.
  7. After this, you can check if a python package could be installed using the above-mentioned command prompt method.

Method 6: Using the exe installer to reinstall Python on your system

  1. Press the Windows key + R to open the Run dialog box.
  2. Type “appwiz.cpl” and then press Enter button.
  3. Search for Python in the Programs and Features screen and then right-click on it and uninstall it.
  4. Now, go through the complete uninstalling process.
  5. Restart the computer system and then download the newest version of the python installer for your operating system.
  6. Execute the exe installer file and make sure that you check the Add Python 3.x to PATH check box. Here, x is the python version that you are installing.
  7. Click on Customize Installation option. Also, ensure that the pip check box is checked in the Option Features. Click on the Next button.
  8. You can edit the installation location or leave it as it is.
  9. Click on the Install button. After completing the installation, you would be asked to reboot the computer system again.
  10. When your computer system has restarted, you can install a pip python package using the command prompt.
  11. Type the python -m ensurepip –default-pip command in cmd if you are still experiencing the same error.

Conclusion

We went through several ways to fix the “pip is not recognized as an internal or external command” error. Each of these methods covers everything from verifying if the error exists to complete fixing it for good. Carefully following these steps can fix the pip not working issue in your computer system. You can try fixing this error either with the Windows graphical user interface or the command prompt. Both ways will provide the same result. Uninstalling and then reinstalling Python is also a simple fix for this error. Just make sure that you check the pip check box during installation.