How to install Python pip on Linux?
 

How to install Python pip on Linux?

 

Python pip is a package management tool used to find, install, remove and list the packages from the Python Package Index (PyPI).

In this article, we will discuss how to install pip for Python 3 and Python 2 on a different distribution of Linux.

If you have not installed Python yet on your Linux system then follow how to install Python 3 on Linux.

How to install pip on Ubuntu/Linux Mint

We need to install pip for Python 2 and 3 separately on Ubuntu/ Linux Mint. Now use the following command for –

Installing pip for Python 3

Use the following command to update the local package database –

sudo apt update

And then use the following command to install pip for Python 3 –

sudo apt install python3-pip

You can verify the installation by using –

pip3 --version

Installing pip for Python 2

First, use the given command to update the local package database –

sudo apt update

To install pip2 for python2 your need to enable universe repository on Ubuntu or Linux mint. Use the following command to use add universe repository on your system –

sudo add-apt-repository universe

And then use –

sudo apt install python2

How to install pip on CentOS/ RHEL

To install pip for python2 and 3 you can use the following commands.

Installing pip for python 3

The Python pip for python 3 comes with the python3 package on CentOS or RHEL. You can install pip3 by using the following command –

sudo yum install python3

You can verify the installation by using –

pip3 --version

Installing pip for python 2

You can install Python 2 package to install Python 2 with pip for it. The python 2 package is available in the epel-release repository.

First, use the following command to install the epel-release repository on your system –

sudo yum install epel-release

And the use the given command to install the package on your system –

sudo yum install python2

You can verify the installation of pip2 by using –

pip2 --version

How to install pip on Arch Linux/ Manjaro

Use the following command to install python3 pip on Arch Linux or Manjaor –

sudo pacman -S python-pip

To install pip for python 2 use –

sudo pacman -S python2 pip

You can verify the installation by using –

pip3 --version

Conclusion

Now pip for Python 2 or 3 is installed on your system. You can use it to find, install or remove a python package on your system. If you have a query related to this then leave it in the comments below.

Previous Setup Python Development Environment With VSCode On Windows
Next Using grep command in Linux
 

About author

You might also like

Python Programming 0 Comments

Python Boolean Data Type

Boolean or bool is a built-in data type in the python programming language. It can have two possible values –   True  False These are equivalent to 1 and 0

Programming 0 Comments

Python List vs Array

Like in many other programming languages Python also provides some inbuilt data types this includes list, tuple, sets, dictionaries, etc. In this article, we will discuss the similarities and differences

Python Programming 0 Comments

Setup Python Development Environment With VS Code In Linux

Visual studio code (VS Code) is a free and open-source IDE that is developed by Microsoft. It is a lightweight IDE that has powerful features like smart code completion, code

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply