CentOS 7.7 및 Python

CentOS 7.7 및 Python

CentOS 7.7이 Python을 버전 3.6으로 업그레이드한다는 내용을 읽었습니다.CentOS Linux 7.7이 출시되었으며, 업데이트 방법은 다음과 같습니다..

내 Centos 7.7 서버에 Python 3.6이 아닌 EOL인 Python 2.7.5가 있는데 yum이 Python 3.6으로 업그레이드할 수 있는 가능성을 제공하지 않는 이유를 누가 설명할 수 있습니까?

[root@cpanel ~]# hostnamectl
   Static hostname: hidden(myserver hostname)
         Icon name: computer-server
           Chassis: server
        Machine ID: ade4e1c7a3534397a3f75bdf9eee8e4d
           Boot ID: 6870183871774c68a23a0c04230d1408
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-514.26.2.el7.x86_64
      Architecture: x86-64

-

[root@cpanel ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

-

[root@cpanel ~]# python -V
Python 2.7.5

-

# cat /etc/yum.conf 
[main]
exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* nsd* p0f php* proftpd* pure-ftpd* spamassassin* squirrelmail*
tolerant=1
errorlevel=1
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release

-

[root@cpanel ~]# yum upgrade python
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
 * EA4: 104.254.183.20
 * cpanel-addons-production-feed: 104.254.183.20
 * cpanel-plugins: 104.254.183.20
 * base: mirror.tzulo.com
 * epel: mirror.steadfastnet.com
 * extras: mirror.den01.meanservers.net
 * updates: mirror.sesp.northwestern.edu
No packages marked for update

답변1

Python 3은 패키지로 제공됩니다 python3.

yum install python3

인터프리터는 여전히 Python 2 인터프리터를 실행 python3합니다 .python

Python 2는 PSF에 의해 EOL로 선언되었지만Red Hat은 여전히 ​​RHEL에서 Python 2에 대한 지원을 제공합니다., CentOS는 이 지원의 혜택을 계속 누릴 것입니다.

답변2

CentOS의 Python 2.7.5는 CentOS 7의 전체 수명 동안 지원되므로 실제로 EOL이 아닙니다. Red Hat Enterprise Linux 7과 함께 제공되는 Python 2.7.5의 경우에도 마찬가지입니다.

Python 3을 구하려면 다음 명령을 사용하여 설치할 수 있습니다.

yum install python3

CentOS Software Collections Repo에서도 얻을 수 있습니다.

yum install centos-release-scl

그런 다음 다음 명령을 사용하여 Python 3에서 3.6까지의 모든 하위 버전 버전을 설치할 수 있습니다.

yum install rh-python33
yum install rh-python34
yum install rh-python35
yum install rh-python36

관련 정보