How to Fix “pip is not recognized as an internal or external command” Error?

When encountering the error “pip is not recognized as an internal or external command,” it typically occurs when trying to use pip in the command prompt, but the system cannot find the executable.

This error means that the command-line interpreter cannot locate the pip executable within the directories listed in the system’s PATH variable (a list of directories where the system looks for executable files).

Our investigation into this issue, based on user reports and personal testing, uncovered several common causes for this error message:

  • PIP installation not added to system variables – Having the path of your pip installation added to your PATH system variable is a prerequisite for running Python commands from a CMD window. The installation should automatically add this if Python is installed using the official executable.
  • Incorrect PATH entry – Manually adding the PATH can result in errors, such as inserting extra spaces or missing a necessary semicolon, which leads to the error message.

If you are currently struggling with this error, preventing the use of Python commands in CMD, the methods detailed below have been verified to work by at least one user.

1. Check if PIP is Added to your PATH Variable

First step is, checking if pip’s path has been correctly added to your system’s PATH variable, you can confirm whether command-line operations can detect and execute pip. If they can’t, it’s likely because the PATH doesn’t include the necessary directory, and simply adding it might get things back on track.

  1. Press Windows key + R to open the Run dialog box. Type cmd and press Enter to open Command Prompt.
    Run dialog: cmd
    Run dialog: cmd
  2. In the Command Prompt window, type echo %PATH% and press Enter. This command will display all locations included in the PATH variable.
    Checking the PIP installation in the PATH variable
    Checking the PIP installation in the PATH variable
  3. If you see a path similar to C:\Python**\Scripts (with ** representing your installed Python version), then the installation path is in your PATH variable.

If PIP is confirmed to be missing from the PATH as an environment variable, and the Python distribution is already installed, you’ll need to add it manually.

  1. Press Windows key + R to open a Run dialog box. Type sysdm.cpl and press Enter to access the System Properties window.
    Run dialog: sysdm.cpl
    Run dialog: sysdm.cpl
  2. In the System Properties window, navigate to the Advanced tab and click on Environment Variables.
    Access the Advanced tab to find Environment Variables
    Access the Advanced tab to find Environment Variables
  3. In the Environment Variables window, under System variables, locate and select Path. With Path highlighted, click on Edit….
    Select the Path entry under System variables and click Edit
    Select the Path entry under System variables and click Edit
  4. In the Edit Environment Variable window, click New and add the path where the pip installation is located. The default location for Python 3.4, for example, is C:\Python34\Scripts. Note: This path may differ based on your Python version or if you have a different version installed.
    Adding the pip installation location
    Adding the pip installation location
  5. After adding the path, open a new CMD window and attempt to install a Python package using pip.

2. Install a Python Package Without Adding the pip Variable

If adding pip to the PATH environment variable is not a viable solution, or if you’ve tried the previous methods and are still facing the error, you can install Python packages from CMD using alternative commands.

This approach avoids the need to rely on the PATH variable by using Python itself to call upon the package installer directly. Prefacing your pip command with python -m explicitly directs Python to run the pip module as a script.

The Short Method:

  1. Press Windows key + R to open a Run dialog box. Type cmd and press Enter to open a Command Prompt window.
    Run dialog: cmd
    Run dialog: cmd
  2. Execute the command below, replacing ‘[packagename]’ with the name of the package you want to install:
    python -m pip install [packagename]

The Long Method:

  1. Press Windows key + R to activate the Run dialog. Type cmd and hit Enter to launch Command Prompt.
    Run dialog: cmd
    Run dialog: cmd
  2. In Command Prompt, use the command below to navigate to the directory where your Python ‘.whl’ file is located:
    cd C:\python installs

    Note: The directory called ‘python installs’ in this example contains the Python installation packages. Modify this command according to the location of your .whl file.

  3. To install the desired Python package using pip, execute this command:
    c:\python37\scripts\pip.exe install [package].whl

    Note: Modify the python installation location based on your Python version or installation path, and replace ‘[package]’ with the actual package name.

If you’re still not able to install Python packages using CMD after these two methods, make sure pip is included in your Python installation with the next strategy.

3. Make Sure that pip is Included in your Python Installation

During installation, it’s possible that the pip feature was not selected, leading to its absence in the system’s environment. By adjusting your existing Python installation to include pip, you reinstate its functionality, allowing your system to recognize pip commands across the Command Prompt.

This corrective measure helps close the gap between your Python environment and the essential package manager.

  1. Launch a Run dialog box by pressing Windows key + R. Enter appwiz.cpl and press Enter to open Programs and Features.
  2. In Programs and Features, right-click on your Python installation and choose Change.
    Adjust the Python installation
    Adjust the Python installation
  3. In the Modify Setup pop-up window, click Modify.
    Select Modify to check if pip is installed
    Select Modify to check if pip is installed
  4. On the Optional Features screen, make sure the pip option is ticked, then select Next.
    Edit the Python installation to include pip
    Edit the Python installation to include pip
  5. Press the Install button to apply the changes to the Python installation.
    Applying modifications to the Python installation
    Applying modifications to the Python installation
  6. Checking whether pip works properly with your Python installation in a CMD window will reveal if the error has been fixed.

4. Install Python Using the Executable Installer

During installation, checking the Add Python to PATH option is important as it allows for easy access to Python and pip commands directly from the command line, bypassing previous path issues. This approach is a comprehensive reset that removes any previous misconfigurations.

  1. Open the Run dialog by pressing Windows key + R. Type appwiz.cpl and press Enter to enter Programs and Features.
  2. Find the Python installation in Programs and Features. Right-click it and choose Uninstall. Follow the displayed instructions to uninstall the program, and then restart your computer.
    Uninstalling Python from the system
    Uninstalling Python from the system
  3. After restarting, visit the website at this link (here) to download the latest Python executable installer appropriate for your OS architecture.
  4. Execute the installer, first making sure to check Add Python to PATH to enable Python commands in Command Prompt. Next, select Customize installation.Check 'Add Python to PATH' and click 'Customize installation' Check ‘Add Python to PATH’ and click ‘Customize installation'</caption]
  5. In the next step, verify that pip is checked among the optional features, then click Next.Confirm that pip is selected under Optional Features Confirm that pip is selected under Optional Features</caption]
  6. Keep the default settings and Advanced Options as they are, and proceed with the installation by clicking Install.Proceed with the Python installation Proceed with the Python installation</caption]
  7. If the system doesn’t prompt you to restart, do so manually.
  8. After the system has restarted, try to install a Python package using the CMD window to verify if the issue has been resolved.
  9. If the error continues, open a CMD window and enter the following command:
    python -m ensurepip --default-pip

    Note: In certain cases, particularly with Python version 3.6, pip might not come with the default installation. This command is an official fix recommended in the documentation for such issues.

ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.

Comments

45
    ΓΡ
    Γιώργος Ράπτης Dec 15, 2018

    congrats for the post

    LP
    Lal Prasanth Apr 4, 2019

    Appreciated for your post

    LP
    Lal Prasanth Apr 4, 2019

    Appreciated for your post

    CK
    Caleb Kemboi Jun 19, 2019

    thanks for the post!

    RM
    Roger Melo Jul 14, 2019

    thank you very much! =D

    JA
    jad Jul 14, 2019

    thank you for the post

    BA
    Bat Aug 11, 2019

    Thanks. I appreciate this

    HR
    Hemanth Ramineni Aug 14, 2019

    I can’t find the scripts file at all

      SW
      Shane Warren Author Aug 17, 2019

      Has python been installed on your computer?

    MR
    mraj Sep 15, 2019

    Thank you very much

    AH
    AHMED Nov 6, 2019

    last method worked for me!!!!…THANK YOU…REALLY!!

    DP
    Derian Palma Nov 14, 2019

    I had this issue. Solved via Method 6.

    DE
    Dewanata Dec 13, 2019

    I had that issue and use all of the instructions above but not even once’s working, in the end of the day, all of my problem is because of “not restarting the pc after installing python”. LOL

    Reply
    DE
    Dewanata Dec 13, 2019

    I solve my problem by restarting the PC. The main issue is because after installing python, the system is not recognizing the pip command, LOL.

    UL
    Ultracloud Jan 10, 2020

    Or also, maybe you don’t have visual C++ 2015.

    CO
    Charles-Tunde Owolabi Jan 15, 2020

    Thank you very much for this piece. The last method worked for me. you really relieved me

    TA
    Tal Feb 26, 2020

    a savior thank you!!!!!!!!

    FZ
    Fang Zerwei Mar 30, 2020

    Absolutely helpful and this tutorial guide is timely for me.
    It has solved the problem i encounter.
    Big Thank to Kevin Arrows !!!

    MU
    Mugen May 1, 2020

    Method 6 helped. Thanks a lot!

    JT
    Joyner Ortiz Tavarez Jun 22, 2020

    Gracias por la ayuda

    JS
    jim snyder Aug 30, 2020

    Item 9 fixed my problem. Thx a bunch!

    Onur Güngör Şahin Sep 14, 2020

    thanks a lot

    AS
    Ankita Srivastava Nov 20, 2020

    thanks a lot. just reading and following the solutions mentioned i realized my python was 32 bit vs all other related packages are 64 bit. reinstalling python 64 bit solved the problem for me

    Reply
    KI
    Kathryn Irish Feb 22, 2021

    thank you for this!

    GL
    gabriel lopes Mar 7, 2021

    Thank you a lot! Method 6 helped

    N1
    n1123 Apr 29, 2021

    Thank you very much! Method 6 worked for me.

    HC
    houari carl ould chih May 27, 2021

    we could just add python as variable instead for that gonna work

    Reply
    JA
    Jawad AbdElkarim Jun 24, 2021

    Very Helpful Thank you so Much

    JE
    Jeremey Jul 13, 2021

    Thanks bro! Very useful

    AP
    appapo Aug 3, 2021

    i just simply write pip , and it works it

    AB
    Alexander Bandura Aug 12, 2021

    TYSM

    AB
    Alexander Bandura Aug 13, 2021

    Great web Thanks!

    AA
    Ahmed Atef Oct 10, 2021

    The only solution that worked was uninstalling and reinstalling, this is so helpful thank you so much

    AL
    Alok Oct 11, 2021

    Thank you Kevin Arrows
    I was trying from 2days to install “pip install pyttsx3” but it was continously showing “pip is not recognized”
    after seeing this slide it workedI suggest everyone whosoever is seeing ^this problem kindly see this slide……….

    GD
    Gana Dube Oct 20, 2021

    How can I get vscode to recognize the packages installed with pip?

    AR
    ariyasinghe Nov 28, 2021

    Thank you very mutch

    AR
    ariyasinghe Nov 28, 2021

    Thank you very much

    SL
    Slink Dec 6, 2021

    Method 3 is the easiest and most effiicient if you’re a newbie like me. Good luck! Thank you Kevin Arrows!

    AM
    Amanshu Dec 12, 2021

    Thank you. bro you saved my day.

    IF
    iFreaku Jan 4, 2022

    Ooooh man thanks very much
    the last process is very trusty in which you have to reinstall python

    DH
    Dilyab Hassany Jan 22, 2022

    Try all below, atleast one should work.
    1) ‘py -m pip install numpy’ OR
    2) ‘python -m pip install numpy’ OR
    3) ‘py -m pip3 install numpy’ OR
    4) ‘python -m pip3 install numpy’

    Reply
    DA
    Dave Feb 16, 2022

    Thank you very much! it worked like a charm

    EO
    Eddie Ogyner Feb 16, 2022

    I’ve been trying to resolve this issue for more than a long time. Thanks a lot for the help.

    NR
    Navhi Rushcore Mar 22, 2022

    THANK YOU VERY MUCH

    DB
    Daniel Burch May 28, 2022

    THANK YOU! steps 1 + 2 fixed my issue!