Python 3.3 インストール2016/07/07 | 
| 
 
CentOS 7 標準の Python のバージョンは 2.7系ですが、3.3系を RPM パッケージでインストールします。
 
 | 
|
| [1] | CentOS SCLo Software Collections からインストール可能です。 なお、デフォルトバージョンの 2.7系がインストールされた状態でも、Software Collections パッケージは別パスにインスールされるため、複数バージョンの共存が可能となっています。  | 
| 
 # SCLoからインストール [root@dlp ~]# yum --enablerepo=centos-sclo-rh -y install python33  
 | 
| [2] | Software Collections パッケージは /opt 配下にインストールされます。 環境変数を読み込んで利用するには以下のように実行します。  | 
| 
 # 環境変数を読み込む [root@dlp ~]# scl enable python33 bash  
[root@dlp ~]#  
[root@dlp ~]# python -V  Python 3.3.2 which python  /opt/rh/python33/root/usr/bin/python  | 
| [3] | ログイン時に自動的に有効にするには以下のように設定します。 | 
| 
 
[root@dlp ~]#  
vi /etc/profile.d/python33.sh  # 以下の内容で新規作成 #!/bin/bash source /opt/rh/python33/enable export X_SCLS="`scl enable python33 'echo $X_SCLS'`"  | 
| Sponsored Link | 
| 
 |