CentOS 7: install python36 and python36-pip


Requirement: epel repo

Step 1:

Remove all old python verions like:

[root@tutorialspots ~]# yum remove python34*
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
--> Running transaction check
---> Package python34.x86_64 0:3.4.10-5.el7 will be erased
---> Package python34-libs.x86_64 0:3.4.10-5.el7 will be erased
---> Package python34-numpy.x86_64 0:1.12.1-3.el7 will be erased
---> Package python34-pip.noarch 0:8.1.2-12.el7 will be erased
---> Package python34-setuptools.noarch 0:39.2.0-4.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                   Arch         Version               Repository   Size
================================================================================
Removing:
 python34                  x86_64       3.4.10-5.el7          @epel        36 k
 python34-libs             x86_64       3.4.10-5.el7          @epel        29 M
 python34-numpy            x86_64       1.12.1-3.el7          @epel        16 M
 python34-pip              noarch       8.1.2-12.el7          @epel       6.8 M
 python34-setuptools       noarch       39.2.0-4.el7          @epel       2.9 M

Transaction Summary
================================================================================
Remove  5 Packages

Installed size: 55 M
...
  Erasing    : python34-numpy-1.12.1-3.el7.x86_64                           2/5
  Erasing    : python34-setuptools-39.2.0-4.el7.noarch                      3/5
  Erasing    : python34-libs-3.4.10-5.el7.x86_64                            4/5
  Erasing    : python34-3.4.10-5.el7.x86_64                                 5/5
  Verifying  : python34-setuptools-39.2.0-4.el7.noarch                      1/5
  Verifying  : python34-libs-3.4.10-5.el7.x86_64                            2/5
  Verifying  : python34-pip-8.1.2-12.el7.noarch                             3/5
  Verifying  : python34-3.4.10-5.el7.x86_64                                 4/5
  Verifying  : python34-numpy-1.12.1-3.el7.x86_64                           5/5

Removed:
  python34.x86_64 0:3.4.10-5.el7            python34-libs.x86_64 0:3.4.10-5.el7
  python34-numpy.x86_64 0:1.12.1-3.el7      python34-pip.noarch 0:8.1.2-12.el7
  python34-setuptools.noarch 0:39.2.0-4.el7

Complete!

Step 2:

yum install -y python36 python36-pip

Result:

[root@tutorialspots ~]# yum install -y python36 python36-pip
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.host-engine.com
 * epel: dfw.mirror.rackspace.com
 * extras: mirrors.usinternet.com
 * nux-dextop: mirror.li.nux.ro
 * remi-safe: mirror.pit.teraswitch.com
 * updates: repos-tx.psychz.net
Package python36 is obsoleted by python3, trying to install python3-3.6.8-13.el7.x86_64 instead
Package python36-pip is obsoleted by python3-pip, trying to install python3-pip-9.0.3-7.el7_7.noarch instead
Resolving Dependencies
--> Running transaction check
---> Package python3.x86_64 0:3.6.8-13.el7 will be installed
--> Processing Dependency: python3-libs(x86-64) = 3.6.8-13.el7 for package: python3-3.6.8-13.el7.x86_64
--> Processing Dependency: python3-setuptools for package: python3-3.6.8-13.el7.x86_64
--> Processing Dependency: libpython3.6m.so.1.0()(64bit) for package: python3-3.6.8-13.el7.x86_64
---> Package python3-pip.noarch 0:9.0.3-7.el7_7 will be installed
--> Running transaction check
---> Package python3-libs.x86_64 0:3.6.8-13.el7 will be installed
---> Package python3-setuptools.noarch 0:39.2.0-10.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                  Arch         Version              Repository     Size
================================================================================
Installing:
 python3                  x86_64       3.6.8-13.el7         base           69 k
 python3-pip              noarch       9.0.3-7.el7_7        updates       1.8 M
Installing for dependencies:
 python3-libs             x86_64       3.6.8-13.el7         base          7.0 M
 python3-setuptools       noarch       39.2.0-10.el7        base          629 k

Transaction Summary
================================================================================
Install  2 Packages (+2 Dependent packages)

Total download size: 9.4 M
Installed size: 48 M
Downloading packages:
(1/4): python3-3.6.8-13.el7.x86_64.rpm                     |  69 kB   00:00
(2/4): python3-setuptools-39.2.0-10.el7.noarch.rpm         | 629 kB   00:00
(3/4): python3-pip-9.0.3-7.el7_7.noarch.rpm                | 1.8 MB   00:00
(4/4): python3-libs-3.6.8-13.el7.x86_64.rpm                | 7.0 MB   00:00
--------------------------------------------------------------------------------
Total                                              9.4 MB/s | 9.4 MB  00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : python3-setuptools-39.2.0-10.el7.noarch                      1/4
  Installing : python3-libs-3.6.8-13.el7.x86_64                             2/4
  Installing : python3-3.6.8-13.el7.x86_64                                  3/4
  Installing : python3-pip-9.0.3-7.el7_7.noarch                             4/4
  Verifying  : python3-pip-9.0.3-7.el7_7.noarch                             1/4
  Verifying  : python3-3.6.8-13.el7.x86_64                                  2/4
  Verifying  : python3-setuptools-39.2.0-10.el7.noarch                      3/4
  Verifying  : python3-libs-3.6.8-13.el7.x86_64                             4/4

Installed:
  python3.x86_64 0:3.6.8-13.el7        python3-pip.noarch 0:9.0.3-7.el7_7

Dependency Installed:
  python3-libs.x86_64 0:3.6.8-13.el7  python3-setuptools.noarch 0:39.2.0-10.el7

Complete!

Leave a Reply