Howto install pip on Centos 7.x and RHEL

Howto install pip on Centos 7.x and RHEL

CentOS

Pip is tool for package management and installation on Python.

Method 1: Install pip by yum command

[root@IThelpblog ~]# yum install python-pip
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.viethosting.vn
* epel: mirror.wanxp.id
* extras: mirror.readyspace.com
* updates: mirrors.viethosting.vn
Resolving Dependencies
–> Running transaction check
—> Package python-pip.noarch 0:7.1.0-1.el7 will be installed
–> Processing Dependency: python-setuptools for package: python-pip-7.1.0-1.el7.noarch
–> Running transaction check
—> Package python-setuptools.noarch 0:0.9.8-4.el7 will be installed
–> Processing Dependency: python-backports-ssl_match_hostname for package: python-setuptools-0.9.8-4.el7.noarch
–> Running transaction check
—> Package python-backports-ssl_match_hostname.noarch 0:3.4.0.2-4.el7 will be installed
–> Processing Dependency: python-backports for package: python-backports-ssl_match_hostname-3.4.0.2-4.el7.noarch
–> Running transaction check
—> Package python-backports.x86_64 0:1.0-8.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================================
Installing:
python-pip noarch 7.1.0-1.el7 epel 1.5 M
Installing for dependencies:
python-backports x86_64 1.0-8.el7 base 5.8 k
python-backports-ssl_match_hostname noarch 3.4.0.2-4.el7 base 12 k
python-setuptools noarch 0.9.8-4.el7 base 396 k

Transaction Summary
=================================================================================================================================================================================
Install 1 Package (+3 Dependent packages)

Total download size: 1.9 M
Installed size: 8.6 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): python-backports-1.0-8.el7.x86_64.rpm | 5.8 kB 00:00:00
(2/4): python-backports-ssl_match_hostname-3.4.0.2-4.el7.noarch.rpm | 12 kB 00:00:01
(3/4): python-setuptools-0.9.8-4.el7.noarch.rpm | 396 kB 00:00:01
(4/4): python-pip-7.1.0-1.el7.noarch.rpm | 1.5 MB 00:00:02
———————————————————————————————————————————————————————————
Total 595 kB/s | 1.9 MB 00:00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python-backports-1.0-8.el7.x86_64 1/4
Installing : python-backports-ssl_match_hostname-3.4.0.2-4.el7.noarch 2/4
Installing : python-setuptools-0.9.8-4.el7.noarch 3/4
Installing : python-pip-7.1.0-1.el7.noarch 4/4
Verifying : python-pip-7.1.0-1.el7.noarch 1/4
Verifying : python-setuptools-0.9.8-4.el7.noarch 2/4
Verifying : python-backports-1.0-8.el7.x86_64 3/4
Verifying : python-backports-ssl_match_hostname-3.4.0.2-4.el7.noarch 4/4

Installed:
python-pip.noarch 0:7.1.0-1.el7

Dependency Installed:
python-backports.x86_64 0:1.0-8.el7 python-backports-ssl_match_hostname.noarch 0:3.4.0.2-4.el7 python-setuptools.noarch 0:0.9.8-4.el7

Complete!
[root@IThelpblog  ~]#

Method 2: Install by curl and use Python to install

[root@IThelpblog  ~]# curl “https://bootstrap.pypa.io/get-pip.py” -o “get-pip.p
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1476k 100 1476k 0 0 1154k 0 0:00:01 0:00:01 –:–:– 1155k
[root@IThelpblog ~]# python get-pip.py
Collecting pip
Downloading pip-8.0.3-py2.py3-none-any.whl (1.2MB)
100% |████████████████████████████████| 1.2MB 124kB/s
Collecting wheel
Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
100% |████████████████████████████████| 69kB 1.7MB/s
Installing collected packages: pip, wheel
Found existing installation: pip 7.1.0
Uninstalling pip-7.1.0:
Successfully uninstalled pip-7.1.0
Successfully installed pip-8.0.3 wheel-0.29.0
[root@IThelpblog  ~]#

 

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>