amazon linux2 に python3 を instlal する

結論から。

以下の一行のみ。

yum install python3

実施結果は以下の通り

# yum install python3
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.team-cymru.com
 * epel: mirror.steadfastnet.com
 * extras: mirrors.liquidweb.com
 * remi-safe: mirror.team-cymru.com
 * updates: centosz6.centos.org
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: python3-pip 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
--> Running transaction check
---> Package python3-libs.x86_64 0:3.6.8-13.el7 will be installed
--> Processing Dependency: libtirpc.so.1()(64bit) for package: python3-libs-3.6.8-13.el7.x86_64
---> Package python3-pip.noarch 0:9.0.3-7.el7_7 will be installed
---> Package python3-setuptools.noarch 0:39.2.0-10.el7 will be installed
--> Running transaction check
---> Package libtirpc.x86_64 0:0.2.4-0.16.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
Installing for dependencies:
 libtirpc                                                x86_64                                      0.2.4-0.16.el7                                      base                                          89 k
 python3-libs                                            x86_64                                      3.6.8-13.el7                                        base                                         7.0 M
 python3-pip                                             noarch                                      9.0.3-7.el7_7                                       updates                                      1.8 M
 python3-setuptools                                      noarch                                      39.2.0-10.el7                                       base                                         629 k

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

Total download size: 9.5 M
Installed size: 48 M
Is this ok [y/d/N]: y   
Downloading packages:
(1/5): libtirpc-0.2.4-0.16.el7.x86_64.rpm                                                                                                                                            |  89 kB  00:00:01     
(2/5): python3-3.6.8-13.el7.x86_64.rpm                                                                                                                                               |  69 kB  00:00:01     
(3/5): python3-setuptools-39.2.0-10.el7.noarch.rpm                                                                                                                                   | 629 kB  00:00:00     
(4/5): python3-pip-9.0.3-7.el7_7.noarch.rpm                                                                                                                                          | 1.8 MB  00:00:00     
(5/5): python3-libs-3.6.8-13.el7.x86_64.rpm                                                                                                                                          | 7.0 MB  00:00:00     
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                       3.7 MB/s | 9.5 MB  00:00:02     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libtirpc-0.2.4-0.16.el7.x86_64                                                                                                                                                           1/5 
  Installing : python3-setuptools-39.2.0-10.el7.noarch                                                                                                                                                  2/5 
  Installing : python3-libs-3.6.8-13.el7.x86_64                                                                                                                                                         3/5 
  Installing : python3-3.6.8-13.el7.x86_64                                                                                                                                                              4/5 
  Installing : python3-pip-9.0.3-7.el7_7.noarch                                                                                                                                                         5/5 
  Verifying  : python3-pip-9.0.3-7.el7_7.noarch                                                                                                                                                         1/5 
  Verifying  : python3-3.6.8-13.el7.x86_64                                                                                                                                                              2/5 
  Verifying  : libtirpc-0.2.4-0.16.el7.x86_64                                                                                                                                                           3/5 
  Verifying  : python3-setuptools-39.2.0-10.el7.noarch                                                                                                                                                  4/5 
  Verifying  : python3-libs-3.6.8-13.el7.x86_64                                                                                                                                                         5/5 

Installed:
  python3.x86_64 0:3.6.8-13.el7                                                                                                                                                                             

Dependency Installed:
  libtirpc.x86_64 0:0.2.4-0.16.el7               python3-libs.x86_64 0:3.6.8-13.el7               python3-pip.noarch 0:9.0.3-7.el7_7               python3-setuptools.noarch 0:39.2.0-10.el7              

Complete!

pip3 も一緒にインストールされる