Bobcares

PiP is not recognized as an internal or external command

by | Apr 22, 2021

We come across the error, PiP is not recognized as an internal or external command when we try to install Python packages using a Command Prompt window.

As part of our Server Management Services, we assist our customers with several Python queries.

Today, let us discuss the error, PiP is not recognized as an internal or external command.

 

PiP is not recognized as an internal or external command

Most users make use of PiP to install and manage Python packages found in the Python Package Index.

PiP is not recognized as an internal or external command

This error means that the Python is either not installed or the system variable path has not been set.

Some customers report that the issue occurs even after installing the Python distribution and making sure that Python is in the path variable.

The major causes of this error include:

  • PIP installation is not added to the system variable

In order to run Python commands from a CMD window, we need to add the path of PiP installation to our PATH in the system variable.

  • The installation is incorrectly added in our PATH

When we add the PATH manually, additional space or a missing semicolon before the new PATH will end up in the error.

 

Solutions

Moving ahead, let us see the solutions our Support Techs employ in order to fix the error.

Method 1: Check if PIP is added to our PATH variable

  1. Type “cmd” in the Run prompt and press Enter.
  2. Inside the command prompt window, type echo %PATH% and press Enter to list all locations in the PATH variable.
  3. A path similar to C:\Python37\Scripts means that the installation path already exists in the PATH variable.

Method 2: Add PIP to the PATH environment variable using the Windows GUI

  1. Type “sysdm.cpl” in the Run prompt and press Enter.
  2. Inside the System Properties screen, go to Advanced tab >> Environment Variables.
  3. In there, go to System variables and click on Path to select it. Then click Edit…
  4. In the Edit environment variable screen, click on New and add the path where the PiP installation is located.
  5. Once done, we open a fresh CMD window install a python package that comes with PiP.

Method 3: AddPIP to the PATH environment variable using CMD

An easy way is to do it directly from a CMD window.

We follow the following steps to set the PiP path environment directly from a Command Prompt window:

  1. Type “cmd” in the Run prompt and press Enter to open a Command Prompt window.
  2. Then, run the following command to set the PIP installation to the environment variable:
    setx PATH “%PATH%;C:\Python37\Scripts”

In the command, we can change the Python version after ‘;‘ accordingly.

Method 4: Open the Python package without adding the PiP variable

In order to do this, we can use a couple of different commands. This also works if we use the methods above to configure the environment PATH variable but still stuck with the error.

The Short Method:

  1. Type “cmd” in the Run prompt and press Enter.
  2. Then type the following commands and make sure to change the placeholder to our own package name:
    python -m pip install [packagename]

The Long Method:

  1. Type “cmd” in the Run prompt and hit Enter.
  2. In the CMD window, use the following command to navigate to the directory where the python .whl file is.
    cd C:\python installs
  3. Next, run the following command to install the Python package using pip:
    c:\python37\scripts\pip.exe install [package].whl

We change the location of our python installation according to the version or if we install it in a custom location. Also, make sure to change the [package] placeholder to our own package name.

Method 5: Ensure that PiP is included in Python installation

Before reinstalling the whole Python environment, we need to check whether PiP was not omitted from the Python installation. Certain Python installers will leave PiP out of the default installation.

We can rectify this by modifying the Python installation and modifying it to install PIP. Follow the steps given below:

  1. Type “appwiz.cpl” in the Run prompt and press Enter to open Programs and Features.
  2. Then, right-click on the Python installation and click Change.
  3. At the Modify Setup screen, click on Modify.
  4. In the Optional Features screen, check the box associated with pip and click Next.
  5. Then hit the Install button to make the changes to the Python installation.

Once done, open a CMD window and see if we are able to install a Python package with PiP without the error.

Method 6: Install Python via the executable installer

Reinstalling Python along with its components will likely resolve this error.

The easiest way is to use the Python executable installer. If we configure it correctly, it will automatically install PiP.

  1. Type “appwiz.cpl” in the Run prompt and press Enter to open Programs and Features.
  2. Scroll down to find the Python installation. Once we find it, right-click and choose Uninstall, then follow the on-screen prompts to remove it from our system. Once done, restart the machine.
  3. At the next startup, visit the URL given below and download the latest Python executable installer according to our OS architecture.
    https://www.python.org/downloads/windows/
  4. Open the installation executable and check the box near Add Python to PATH. Then, click on Customize installation.
  5. In the Optional Features window, make sure to check the box associated with pip, then click Next.
  6. Leave the default location and Advanced Options, then click Install to commence the installation.
  7. Once done, restart the computer manually.
  8. Then, try to install a Python package via a CMD window.
  9. If we are still seeing the error, type the following command in a CMD window:
    python -m ensurepip --default-pip

[Couldn’t solve the error? We are here for you]

 

Conclusion

In short, the error, “PiP is not recognized as an internal or external command” occurs when we try to install Python packages via a Command Prompt window.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

1 Comment

  1. Quiz Dev

    Nice article but if you provide some image I think your article will be better

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF