CentOS 8
Sponsored Link

Python 3.8 : インストール2020/06/23

 
Python 3.8 をインストールします。
[1] AppStream からインストール可能です。
[root@dlp ~]#
dnf module -y install python38

CentOS-8 - AppStream                            5.2 MB/s | 5.8 MB     00:01
CentOS-8 - Base                                 3.2 MB/s | 2.2 MB     00:00
CentOS-8 - Extras                               6.3 kB/s | 6.7 kB     00:01
Dependencies resolved.
==========================================================================================
 Package                     Arch    Version                              Repo        Size
==========================================================================================
Installing group/module packages:
 python38                    x86_64  3.8.0-6.module_el8.2.0+317+61fa6e7d  AppStream   76 k
Installing dependencies:
 python38-libs               x86_64  3.8.0-6.module_el8.2.0+317+61fa6e7d  AppStream  8.2 M
 python38-pip-wheel          noarch  19.2.3-5.module_el8.2.0+317+61fa6e7d AppStream  1.2 M
 python38-setuptools-wheel   noarch  41.6.0-4.module_el8.2.0+317+61fa6e7d AppStream  304 k
Installing weak dependencies:
 python38-pip                noarch  19.2.3-5.module_el8.2.0+317+61fa6e7d AppStream  1.9 M
 python38-setuptools         noarch  41.6.0-4.module_el8.2.0+317+61fa6e7d AppStream  667 k
Installing module profiles:
 python38/common
Enabling module streams:
 python38                            3.8

Transaction Summary
==========================================================================================
Install  6 Packages
.....
.....

[root@dlp ~]#
python3 -V

Python 3.8.0

# テストスクリプトを作成して動作確認

[root@dlp ~]#
echo -e "import sys\nprint(sys.version)" > python3_test.py

[root@dlp ~]#
python3 python3_test.py

3.8.0 (default, May 7 2020, 02:49:39)
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
[2] バージョン番号を付けない [python] コマンドで使用したい場合は [alternatives] で切り替え可能です。
[root@dlp ~]#
alternatives --config python


There are 3 programs which provide 'python'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/libexec/no-python
   2           /usr/bin/python3
   3           /usr/bin/python3.8

Enter to keep the current selection[+], or type selection number: 3

[root@dlp ~]#
python -V

Python 3.8.0
関連コンテンツ