Posted at

Python 2.7 インストール(yum)(CentOS 6.8)

More than 1 year has passed since last update.


インストール

[root@localhost ~]# yum -y install centos-release-scl-rh

[root@localhost ~]# yum -y install python27


動作確認

[root@localhost ~]# python --version

Python 2.6.6
[root@localhost ~]# scl enable python27 bash
[root@localhost ~]# python --version
Python 2.7.8
[root@localhost ~]# exit


自動有効設定

[root@localhost ~]# python --version

Python 2.6.6
[root@localhost ~]# echo 'source /opt/rh/python27/enable' > /etc/profile.d/python27.sh
[root@localhost ~]# source /etc/profile
[root@localhost ~]# python --version
Python 2.7.8