Fixed! | bash: pip: command not found

Hrishi Parkhe
4 min readJun 10, 2021

--

A copious amount of users are facing an error that appears as bash: pip: command not found, this usually encounters when you install a package using a pip without actually having a package manager installed on your system.

Let me tell you, Python 2 is no longer is developed and maintained, but still, some coders are using it resulting in random multiple issues and errors. If that’s the case, you should start using Python 3, while working with Python 3 it is advised to use pip3 rather than pip.

Moreover, bash: php: command not found error can encounter on any platforms such as Linux, Debian, Ubutu, centOS, Mint, etc. We have covered some effective troubleshoot that will help you to fix bash: php: command not found error.

Make sure to follow the guide till the end that we have managed to provide you. Without further ado, let’s get started.

Also Read: Play Atari Breakdown on Google Chrome! (Quick Steps)

Article Contents hide

1 Why bash: pip: command not found Error Occurs?

2 Use Right Environment

3 Download Python 2 pip

4 FAQs

5 How to Install pip Package for python 2 in Ubuntu, Debian, Mint, and Kali?

6 How to Install pip Package for Python 2 in CentOS, RHEL, Fedora

7 How to Install pip3 package for Python 3 in Ubuntu, Debian, Mint, and Kali?

8 How to Install pip3 for Python 3 in CentOS, RHEL, Fedora?

9 How to Install pip for MacOSX?

10 How to Print pip2 and pip3 Version?

Why bash: pip: command not found Error Occurs?

Mind you, a command not found error occurs when you reference a command that is not present on your system. This issue mostly encounters on Linux, because the pip package manager is an independent package.

If you don’t install pip separately from Python. You will get victimized with a command not found error.

Now let’s see how to fix the command line error.

Use Right Environment

As mentioned, Python 3 command lines depend on the pip3, and Python 2 and later version command lines depend on the pip. Here, we need to make sure that we are using the right environment.

For a demonstration, we will try to install the “requests” library using Python 3. Suppose we use pip in pyhon3, we will encounter the following error:

pip: command not found

Keeping the fact in mind that we are using Python 3, let’s use pip 3. Then the command will be executed without any error:

pip3 install requests

And the installation process will look like the following:

Requirement already satisfied: requests in ./Library/Python/3.8/lib/python/site-packages (2.24.0)

This happened because the request library is already present in our system, else it will appear as an issue.

Download Python 2 pip

If you are using Python 2, then it is advised to use Python 2 pip on your system. Else you will get encountered with pip: command not found error.

Here’s how to install Python 2 pip:

Step 1: Type the command line sudo easy_install pip and press enters to execute.

Step 2: Python 2 pip will be installed on your system.

If you don’t have easy_install installed on your system then type the following command to install it.

sudo apt-get install python-setuptools

Note: It is advised to move your database to Python 3 that is relies in pip3. Python no longer supports Python 2.

Also Read: Attach Multiple Songs In your YouTube Music Playlist

FAQs

Following are some common FAQs related to the topic

How to Install pip Package for python 2 in Ubuntu, Debian, Mint, and Kali?

To install pip package for Python 2 in Ubuntu, Debian, Mint, and kali. Users need to use the following command line.

$ sudo apt install python-pip

How to Install pip Package for Python 2 in CentOS, RHEL, Fedora

To install pip package for Python 2 in CentOS, RHEL, Fedora. Users need to use the following command line.

$ sudo yum install python2-pip

How to Install pip3 package for Python 3 in Ubuntu, Debian, Mint, and Kali?

To install pip3 for Python 3 in Ubuntu, Debian, Mint, and Kali. Users need to use the following command line. Users need to execute the following command.

$ sudo apt install python3-pip

How to Install pip3 for Python 3 in CentOS, RHEL, Fedora?

To install pip3 for Python 3 in CentOS, RHEL, Fedora. Users need to use the following command line. Users need to execute the following command.

$ sudo yum install python3-pip

How to Install pip for MacOSX?

Here, we will install pip for MacOSX by using the “brew” command line.

$ brew install python

How to Print pip2 and pip3 Version?

To print pip2 and pip3, we will use –version to print detailed version and site-packages path.

$ pip --version

That’s it for now, hope this helps! Let us know your thoughts in the comment section below. Till then stay tuned for more info.

Read Next: Let’s Explore Android 12 And its Confirmed Features!

--

--

Hrishi Parkhe

Hrishi is a passinate writer and blogger who own pcboy.org website. while you're here, don't forget to visit our website.