How do I fix pip command not found?

pip command not found error occurs if pip package is not available in the system or path configuration is not correct. The best solution to fix this error is to reinstall this pip again. This will automatically set the path for the pip package manager. In this article, we will explore every angle for this error. So let’s start-

pip command not found : (Solution) –

Actually, windows users need not install the pip package manager separately. If they install python-pip package manager will automatically come in the distribution.

Window User ( pip package manager) –

All you need to visit python official website and download the latest version/ compatible python version.

How do I fix pip command not found?
pip command for windows

pip command not found for Linux User ( pip package manager) –

As I mentioned, pip comes with windows distribution but that is not the case with Linux OS. In Linux, we need to install the pip separately. Here is the command for the same-

sudo apt-get -y install python3-pip

Once we run the above command it will install the pip3 package manager with it.

pip command not found for Mac OS ( pip package manager) –

Similar to windows,  Mac OS Python distribution also contains pip package manager distribution. The easier way to install python is the brew package manager.

brew install python3

How to check pip version?

Here is the command for checking pip version-

pip --version

It will show the current pip version. As the below screenshot signifies the same.

How do I fix pip command not found?
pip version

Similar error in Windows –

“pip command not found” and “‘pip’ is not recognized as an internal or external command, operable program or batch file” is a similar errors. So the solution will be the same for both the errors. The first one comes in the Linux platform and the other one is for the Windows Platform.

Hope you must find this article informative on pip installation and related errors. Please provide your feedback via comment.

Alternative to pip package manager –

If you do not want to proceed with pip then you can install Anaconda distribution. It offers the conda package manager which is completely identical to the pip package manager. There are differences in pip and conda but it will not affect the core motive behind them.

Thanks
Data Science Learner Team

Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

We respect your privacy and take protecting it seriously

Thank you for signup. A Confirmation Email has been sent to your Email Address.

Something went wrong.

Pip is a recursive acronym for either “Pip Installs Packages” or “Pip Installs Python.” Alternatively, pip stands for “preferred installer program.” Basically, it is a package manager that allows you to download and install packages. If you try to install packages without pip installed, you will get an error pip: command not found.

In this article, we will look at the cause of this error and possible solutions to fix this error which you are encountering.

Also, Checkout How to resolve python is not recognized as an internal or external command

The issue differs based on the environment and the os which you are using. Let’s understand how the pip is packaged into different environments.

Error Message from Bash:

bash: pip: command not found

Error Message from DOS command line:

'pip' is not recognized as an internal or external command, operable program or batch file.
  1. Linux – If you have installed Python on a Linux environment, the pip does not come with Python, and you need to install pip package manager as a separate package. Hence in Linux, if you try to install a package, you will get a pip: command not found error as there is no pip package installed.
  2. Mac – On a mac, if you install the latest version of Python 3.x, you don’t have to worry about installing it separately. It comes shipped with Python distributable.
  3. Windows – On windows again, you don’t have to install the pip separately. It comes with Python distributable.

As you already know, Python 2 has reached the end of life, which means it is no longer actively maintained and supported. If you are still using Python 2, then you should consider moving it to Python 3 and it comes with pip3.

How to check if pip is installed correctly?

The first and foremost thing to do is to check if you have already installed pip in your machine. In windows, you can check if the pip is located in the below directory. So just navigate to the directory and do check for pip.exe or pip3.exe files. If it’s not present, then you need to install it.

Check here for pip3.exe:

C:\Users\YOUR_USERNAME\AppData\Local\Programs\Python\Python36\Scripts

Note: Replace the YOUR_USERNAME with your actual username.

Installing pip the right way

1) On windows, run your Python installer once again and ensure you check the install pip checkbox in the wizard as shown in the below image.

How do I fix pip command not found?
Install pip on windows

2) On Linux, you can install pip3 by running an apt-get command in your terminal.

sudo apt-get -y install python3-pip

Once you have run this command, you should use the pip3 package manager commands to download the packages. 

3) On Mac, pip is bundled with the Python distributable, so you need to re-install Python once again by executing the below command. Once you have re-installed Python 3, you should be able to execute pip commands.

brew install python3

Installing pip for Python 2

If you are still working on Python 2 and want to install an older version of a pip, you can install it by running the below command on your Linux machine.

sudo easy_install pip

This command installs the pip command onto your system. If you do not already have easy_install installed, install it using the following Linux command:

sudo apt-get install python-setuptools

How do I fix pip command not found?

Related Tags
  • command not found,
  • pip,
  • preferred installer program

Sign Up for Our Newsletters

Subscribe to get notified of the latest articles. We will never spam you. Be a part of our ever-growing community.

By checking this box, you confirm that you have read and are agreeing to our terms of use regarding the storage of the data submitted through this form.

Why my pip install not working?

One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.

Why is pip not working in CMD?

The error “'pip' is not recognized as an internal or external command” is encountered because of two main reasons that are. PIP Installation path is not added to the system variables: If you have installed python through prompt then you need to configure PIP path manually.

How do I enable pip in Python?

Step 1: Download PIP get-pip.py..
Step 2: Installing PIP on Windows..
Step 3: Verify Installation..
Step 4: Add Pip to Windows Environment Variables..
Step 5: Configuration..

Do I need to install pip?

Usually, pip is automatically installed if you are: working in a virtual environment. using Python downloaded from python.org. using Python that has not been modified by a redistributor to remove ensurepip.