# yum info rh-python35 Loaded plugins:fastestmirror, security Loading mirror speeds from cached hostfile * epel:ewr.edge.kernel.org * remi-safe:mirror.team-cymru.com Available Packages Name :rh-python35 Arch :x86_64 Version :2.0 Release :2.el6 Size :0.0 Repo :installed From repo :centos-sclo-rh Summary :Package that installs rh-python35 License :GPLv2+ Description :This is the main package for rh-python35 Software Collection.
NESTEDTEXT
运行如下命令从 scl 源安装可用的最新版 python 3:
1 2
# yum install rh-python35
1C
运行如下特殊的 scl 命令,在当前 shell 中启用安装的软件包:
1 2
# scl enable rh-python35 bash
SHELL
运行如下命令检查安装的 python3 版本:
1 2 3
# python --version Python3.5.1
APACHE
运行如下命令获取系统已安装的 SCL 软件包列表:
1 2 3
# scl -l rh-python35
1C
方法 2:使用 EPEL 源 (Extra Packages for Enterprise Linux)
EPEL 是 Extra Packages for Enterprise Linux 的缩写,该源由 Fedora SIG (Special Interest Group)维护。
该 SIG 为企业级 Linux 创建、维护并管理了一系列高品质补充软件包,受益的企业级 Linux 发行版包括但不限于红帽企业级 Linux (RHEL)、 CentOS、 Scientific Linux (SL) 和 Oracle Linux (OL)等。
EPEL 通常基于 Fedora 对应代码提供软件包,不会与企业级 Linux 发行版中的基础软件包冲突或替换其中的软件包。
EPEL 软件包位于 CentOS 的 Extra 源中,已经默认启用,故我们只需运行如下命令即可:
1 2
# yum install epel-release
1C
检查可用的 python 3 版本:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# yum --disablerepo="*" --enablerepo="epel" info python34 Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile * epel: ewr.edge.kernel.org Available Packages Name : python34 Arch : x86_64 Version : 3.4.5 Release : 4.el6 Size : 50 k Repo : epel Summary : Version3of the Python programming language aka Python 3000 URL : http://www.python.org/ License : Python Description : Python 3is a newversionof the language that is incompatible with the 2.x : lineof releases. The languageis mostly the same, but many details, especially : how built-in objects like dictionaries and strings work, have changed : considerably, and a lot of deprecated features have finally been removed.
# yum --enablerepo=ius info python36u Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile * epel: ewr.edge.kernel.org * ius: mirror.team-cymru.com * remi-safe: mirror.team-cymru.com Available Packages Name : python36u Arch : x86_64 Version : 3.6.5 Release : 1.ius.centos6 Size : 55 k Repo : ius Summary : Interpreterof the Python programming language URL : https://www.python.org/ License : Python Description : Pythonis an accessible, high-level, dynamically typed, interpreted programming : language, designed with an emphasis on code readability. : It includes an extensive standard library, and has a vast ecosystem of : third-party libraries. : : The python36u packageprovides the "python3.6" executable: the reference : interpreterfor the Python language, version 3. : The majority of its standard library is provided in the python36u-libs package, : which should be installed automatically along with python36u. : The remaining parts of the Python standard library are broken out into the : python36u-tkinter and python36u-test packages, which may need to be installed : separately. : : Documentationfor Python is provided in the python36u-docs package. : : Packages containing additional libraries for Python are generally named with : the"python36u-" prefix.