How can I install pip(Python Indexing Project) command in Linux?

The pip command is useful in installing python modules in your machine. A python module is a block of code to do a specific work. But this pip command is not available by default in CentOS/Redhat/Fedora repos we have to install Extra Packages for Enterprise Linux (or EPEL) repo which is available in net

Step1: Installing EPEL repo using RPM command

	rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

Output:

	

[root@sys1 ~]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
Retrieving http://mirror.centos.net/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
warning: /var/tmp/rpm-tmp.wwXlbn: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]

Step2: Once this EPEL repo is installed our pip package is available for download.

yum install python-pip

Output:

	

[root@sys1 ~]# yum install python-pip
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
epel/metalink | 5.7 kB 00:00
* base: centos.aol.in
* epel: epel.mirror.net.in
* extras: centos.aol.in
* updates: centos.aol.in
epel | 4.2 kB 00:00
epel/primary_db | 4.8 MB 00:02
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package python-pip.noarch 0:1.3.1-4.el6 set to be updated
--> Processing Dependency: python-setuptools for package: python-pip-1.3.1-4.el6.noarch
--> Running transaction check
---> Package python-setuptools.noarch 0:0.6.10-3.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================
Installing:
python-pip noarch 1.3.1-4.el6 epel 330 k
Installing for dependencies:
python-setuptools noarch 0.6.10-3.el6 base 336 k

Transaction Summary
===============================================================================================================================================
Install 2 Package(s)
Upgrade 0 Package(s)

Total download size: 666 k
Installed size: 2.5 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): python-pip-1.3.1-4.el6.noarch.rpm | 330 kB 00:00
(2/2): python-setuptools-0.6.10-3.el6.noarch.rpm | 336 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------------------------
Total 1.1 MB/s | 666 kB 00:00
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
epel/gpgkey | 3.2 kB 00:00 ...
Importing GPG key 0x0608B895 "EPEL (6) <epel@fedoraproject.org>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : python-setuptools-0.6.10-3.el6.noarch 1/2
Installing : python-pip-1.3.1-4.el6.noarch 2/2

Installed:
python-pip.noarch 0:1.3.1-4.el6

Dependency Installed:
python-setuptools.noarch 0:0.6.10-3.el6

Complete!

Check if pip software is installed properly or no by using below command.

yum info pyton-pip

Output:

[root@sys1 ~]# yum info python-pip

	Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
* base: centos.aol.in
* epel: epel.mirror.net.in
* extras: centos.aol.in
* updates: centos.aol.in
Installed Packages
Name : python-pip
Arch : noarch
Version : 1.3.1
Release : 4.el6
Size : 1.0 M
Repo : installed
From repo : epel
Summary : A tool for installing and managing Python packages
URL : http://www.pip-installer.org
License : MIT
Description: Pip is a replacement for `easy_install
: <http://peak.telecommunity.com/DevCenter/EasyInstall>`_. It uses mostly the
: same techniques for finding packages, so packages that were made
: easy_installable should be pip-installable as well.

In our next post we will see how to use this pip command to manage our python modules.

The following two tabs change content below.
Mr Surendra Anne is from Vijayawada, Andhra Pradesh, India. He is a Linux/Open source supporter who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. He works as Devops Engineer with Taggle systems, an IOT automatic water metering company, Sydney . You can contact him at surendra (@) linuxnix dot com.