“pip” not recognized as an internal or external command

Share on facebook
Share on twitter
Share on linkedin
Share on telegram
Share on whatsapp

Contents

Some users trying to install Python packages using a command window report that they see the error »pip is not recognized as an internal or external command«. Most affected users report that the problem occurs even after installing the Python distribution and making sure Python is added to the path variable. The problem is not specific to a certain operating system, since it is reported in Windows 7, Windows 8 and Windows 10.

pip-error-message-7247312$ 0027pip $ 0027 not recognized as an internal or external command, operable program or batch file

What is the PIP?

PiP is a recursive acronym for »Pip Install Packages«. It is essentially a package management system used to install and manage software packages written in Python.. Most users use PiP to install and manage Python packages found in Python Package Index.

The latest versions of Python (Python 2.7.9 and later and Python 3.4) include Pip by default.

What is causing $ 0027pip $ 0027 not recognized as an internal or external command error?

We investigated this topic by examining various user reports and tried to replicate the topic on our computers. From what we have collected, there are several scenarios that are known to trigger this particular error message:

  • PIP installation is not added to system variable: to run Python commands from a CMD window, you will need to add the path of your PIP installation to your PATH in the system variable. If you installed Python using the installation executable, should be added automatically.

  • The installation was incorrectly added to your PATH: it's easy to mess up the PATH if you add it manually. The extra space or semicolon remaining before the new PATH will end up causing the error.

If today you are trying to fix this particular error message that prevents you from using the Python command in CMD, follow the methods announced in this post. All possible fixes listed below have been confirmed to work for at least one affected user.

For best results, Follow the methods listed below in order until you find a solution that helps you fix the problem in your particular situation.

Method 1: check if the PIP is added to your PATH variable

Let's start by finding out where we are. If you don't know if your PIP installation is added to your PATH variable, you can easily find out using a certain command in a CMD prompt.

Knowing this will point you in the right direction and prevent you from taking unnecessary action.

Note: If you already know if your PIP install path was added to your PATH variable, scroll down to the following methods below.

Here is a quick guide to check if the PIP installation is already in your PATH variable:

  1. Press the Windows key + R to open the Run dialog. Then type »cmd» and press Enter to open the command window. cmd-40-7899803Run dialog: cmd

  2. Inside the command line window, type echo% PATH% and hit Enter to get a list of all the locations added to the PATH variable. path-variables-7838528Checking if PIP installation is present in PATH variable

  3. If you can find a path equivalent to C: Python37Scripts (this depends on your python version), it means that the installation path is already added to your PATH variable. In this circumstance, you can jump next to the methods below and jump directly to the Method 4, where we start to fix PiP installation path problems.

If you couldn't find the PIP installation path using the above test, scroll down to the following methods below (Method 2 and Method 3) to add the PIP to the PATH environment variable.

Method 2: add PIP to PATH environment variable using Windows GUI

If the Method 1 It revealed that the PIP installation is not set to the PATH as an environment variable and you have already installed the Python distribution, you will have to do it manually.

After completing the following procedure, you can enter PiP commands from a command window. Here is a quick guide on how to add PiP installation to Path environment variable using Windows GUI:

  1. Press the Windows key + R to open the Run dialog. Then type »sysdm.cpl» and press Enter to open the System Properties screen. system-properties-3-3666409Run dialog: sysdm.cpl

  2. Inside the System Properties screen, go to the Advanced tab, then click Environment Variables. environment-variables-1-1-7632031Go to Advanced tab and click Environment Variables

  3. On the Environment Variables screen, go to System Variables and click Path to select it. Later, with the selected Route, click the Edit ... button. edit-button-4913262Select the Path entry under System Variables and click Edit

  4. On the Edit Environment Variable screen, click New and add the path where the PiP installation is located. For Python 3.4, default location is C: Python34Scripts.

    phyton-scripts-6124555Add PiP install location

  5. Once the path is added, open a new CMD window and try to install a Python package that comes with PiP. You should no longer see the error »pip is not recognized as an internal or external command«.

If you are looking for a faster way to add PiP location to environment variable, follow the method 3.

Method 3: add PIP to PATH environment variable using CMD

A faster way to set the PIP path environment variable is to do it directly from a CMD window. This will save you some time, but it can be a bit more intimidating if you are not used to using the terminal.

Here is a quick guide to setting up the PiP path environment directly from a command window:

  1. Press the Windows key + R to open the Run dialog. Later write “cmd” and hit Enter to open a command window. cmd-41-4549674Run dialog: cmd

  2. In the command window, run the following command to configure PIP installation in environment variable:

    setx PATH "%PATH%;C:Python37Scripts"

    Note: Note that in this command we use the default location for Python 3.7. If you are using a different version of Python or have installed it in a custom location, change path after $ 0027; $ 0027 in consecuense.

  3. See if this method was successful by running a Python installation package (one that uses PIP) from the same CMD window. If you still encounter the error message, scroll down to the next method.

Method 4: open python package without adding PiP variable

If you are looking for a way to install a Python package from CMD without adding PiP to the PATH environment variable, you can use a couple different commands to install it. This also works if you used the above methods to set the PATH environment variable but still get the error message.

Here are a couple of ways you can use to open Python installation packages in CMD without adding the PIP variable:

The short method:

  1. Press the Windows key + R to open the Run dialog. Later write “cmd” and hit Enter to open a command window. cmd-41-4549674Run dialog: cmd

  2. Type the following commands and make sure to change the placeholder to your own package name:

    python -m pip install [package name]

    Note: Change [package name] with the name of the package you are trying to install.

The long method:

  1. Open a Run dialog box by pressing the Windows key + R. Later, scribe “cmd” and press Enter to open a command window. cmd-41-4549674Run dialog: cmd

  2. In the CMD window, use the following command to navigate to the directory where the python .whl file is located.

    cd C:python installs

    Note: In our example, the Python installation package was in a folder called Python installs. Adapt this command to navigate to the directory where the wheel is located.

  3. Later, run the following command to install the python package using PiP:

     c:python37scriptspip.exe install [package].whl 

    Note: Please note the need to change the location of your Python installation if you have an older version or if you installed it in a custom location. At the same time, make sure to change the placeholder [package] by its own package name.

If these last two methods did not allow you to install the Python package from the CMD window, follow the last method below where we make sure PiP is installed.

Method 5: make sure PiP is included in your Python installation

Before proceeding and reinstalling the entire Python environment, let's see if PiP was not skipped from Python installation. Some Python installers will leave PiP out of the default installation.

Fortunately, you can rectify this by modifying the python installation and modifying it to install PIP. Here is a quick guide on how to do this:

  1. Press the Windows key + R to open the Run dialog. Then type »appwiz.cpl» and press Enter to open Programs and Features.

    appwiz-2-54-2708437Run dialog: appwiz.cpl

  2. In Programs and Features, right click on Python install and click Change. change-1-1-1682987Change Python installation

  3. On the Modify Settings screen, click Modify.

    click-on-modify-4303325Click Modify to make sure PiP is installed

  4. On the Optional Features screen, check the box associated with pip and click Next. install-pip-5432426Modify Python installation to include PiP

  5. Press the Install button to make the changes to the Python installation. installatioon-4194091Change Python installation

  6. After modifying the Python installation, open a CMD window and see if you can install a Python package with PiP without seeing the error »pip is not recognized as an internal or external command«.

Method 6: install python via executable installer

If you have come this far in vain, reinstalling Python along with its components will probably resolve the error »pip is not recognized as an internal or external command«.

The easiest way to do it is through the Python executable installer. If you set it up correctly, will install PiP automatically. Here is a quick guide on how to do this:

  1. Press the Windows key + R to open the Run dialog. Then type »appwiz.cpl» and press Enter to open Programs and Features. appwiz-2-54-2708437Run dialog: appwiz.cpl

  2. In Programs and Features, scroll down to the list of programs to find the Python installation. Once i find it, right click on it and choose Uninstall, and then follow the instructions on the screen to remove it from your system. Once the Python distribution has been removed from your computer, reboot your machine. uninstalling-python-5074108Uninstall Python from your machine

  3. At the next boot, visit este link (here) and download the latest Python executable installer according to your OS architecture. downloading-the-executable-installer-1307594Downloading the correct Python executable installer

  4. Open the installation executable and start by making sure the box associated with Add Python to PATH is checked. This ensures that you can run Python commands at the command prompt. Then click on Customize installation. customize-installation-8868200Make sure Python is added to the PATH and then click Custom installation

  5. In the Optional Features window, make sure the box associated with pip is checked and then click Next. pip-9692082Make sure pip is checked in optional functions

  6. Leave the default location and Advanced options, then click Install to start the installation. install-2-1-4175905Python installation

  7. After the installation is complete, restart your computer manually if you are not automatically prompted to do so.

  8. In the next start, see if the problem has been resolved by trying to install a python package through a CMD window.

  9. If you still see the error »pip is not recognized as an internal or external command«, type the following command in a CMD window:

     python -m ensurepip --default-pip
     

    Note: With certain Python distributions (in particular 3.6), PiP may not be installed by default. One of the official fixes for this included in the documentation is this command.

Subscribe to our Newsletter

We will not send you SPAM mail. We hate it as much as you.