AmazonLinux
python2.6

Amazon Linux Python 2.7(default) -> 2.6 へ切り替え

More than 1 year has passed since last update.

Amazon Linux AMI 2015.03 以降、デフォルトのPythonのバージョンが2.7になったのですが、都合上、Python2.6で動かす必要が出てきたので、ドキュメントに従って、Pythonを2.6へ切り替える。
参考: https://aws.amazon.com/jp/amazon-linux-ami/2015.03-release-notes/

どうやら、予定では 2017.09 以降、python26が非推奨になるらしい
参考: https://aws.amazon.com/jp/amazon-linux-ami/2016.09-release-notes/

$ cat /etc/system-release
Amazon Linux AMI release 2017.03

Python2.6インストール

Python2.6とデフォルトで入っていたPython2.7の時に入ってた標準インストールのライブラリ関連の2.6版をインストールしておく

$ yum list installed | grep python27
libxml2-python27.x86_64              2.9.1-6.3.49.amzn1            installed    
newt-python27.x86_64                 0.52.11-3.11.amzn1            installed    
python27.x86_64                      2.7.12-2.120.amzn1            installed    
python27-PyYAML.x86_64               3.10-3.10.amzn1               installed    
python27-babel.noarch                0.9.4-5.1.8.amzn1             installed    
python27-backports.x86_64            1.0-3.14.amzn1                installed    
python27-backports-ssl_match_hostname.noarch
python27-boto.noarch                 2.42.0-1.1.amzn1              installed    
python27-botocore.noarch             1.5.95-1.65.amzn1             installed    
python27-chardet.noarch              2.0.1-7.7.amzn1               installed    
python27-colorama.noarch             0.2.5-1.7.amzn1               installed    
python27-configobj.noarch            4.7.2-7.15.amzn1              installed    
python27-crypto.x86_64               2.6.1-1.14.amzn1              installed    
python27-daemon.noarch               1.5.2-1.5.amzn1               installed    
python27-dateutil.noarch             2.1-1.3.amzn1                 installed    
python27-devel.x86_64                2.7.12-2.120.amzn1            installed    
python27-docutils.noarch             0.11-1.15.amzn1               installed    
python27-ecdsa.noarch                0.11-3.3.amzn1                installed    
python27-futures.noarch              3.0.3-1.3.amzn1               installed    
python27-imaging.x86_64              1.1.6-19.9.amzn1              installed    
python27-iniparse.noarch             0.3.1-2.1.9.amzn1             installed    
python27-jinja2.noarch               2.7.2-2.15.amzn1              installed    
python27-jmespath.noarch             0.9.2-1.12.amzn1              installed    
python27-jsonpatch.noarch            1.2-2.5.amzn1                 installed    
python27-jsonpointer.noarch          1.0-3.4.amzn1                 installed    
python27-kitchen.noarch              1.1.1-5.6.amzn1               installed    
python27-libs.x86_64                 2.7.12-2.120.amzn1            installed    
python27-lockfile.noarch             0.8-3.5.amzn1                 installed    
python27-markupsafe.x86_64           0.11-4.6.amzn1                installed    
python27-paramiko.noarch             1.15.1-1.5.amzn1              installed    
python27-pip.noarch                  6.1.1-1.23.amzn1              installed    
python27-ply.noarch                  3.4-3.12.amzn1                installed    
python27-pyasn1.noarch               0.1.7-2.9.amzn1               installed    
python27-pycurl.x86_64               7.19.0-17.12.amzn1            installed    
python27-pygpgme.x86_64              0.3-9.12.amzn1                installed    
python27-pyliblzma.x86_64            0.5.3-11.6.amzn1              installed    
python27-pystache.noarch             0.5.3-2.8.amzn1               installed    
python27-pyxattr.x86_64              0.5.0-1.6.amzn1               installed    
python27-requests.noarch             1.2.3-5.10.amzn1              installed    
python27-rsa.noarch                  3.4.1-1.8.amzn1               installed    
python27-setuptools.noarch           12.2-1.32.amzn1               installed    
python27-simplejson.x86_64           3.6.5-1.12.amzn1              installed    
python27-six.noarch                  1.8.0-1.23.amzn1              installed    
python27-urlgrabber.noarch           3.10-8.16.amzn1               installed    
python27-urllib3.noarch              1.8.2-1.5.amzn1               installed    
python27-virtualenv.noarch           12.0.7-1.13.amzn1             installed    
rpm-python27.x86_64                  4.11.3-21.75.amzn1            installed    
yum -y install libxml2-python26.x86_64 newt-python26.x86_64 python26.x86_64 python26-PyYAML.x86_64 python26-babel.noarch python26-backports.x86_64 python26-backports-ssl_match_hostname.noarch python26-boto.noarch python26-botocore.noarch python26-chardet.noarch python26-colorama.noarch python26-configobj.noarch python26-crypto.x86_64 python26-daemon.noarch python26-dateutil.noarch python26-devel.x86_64 python26-docutils.noarch python26-ecdsa.noarch python26-futures.noarch python26-imaging.x86_64 python26-iniparse.noarch python26-jinja2.noarch python26-jmespath.noarch python26-jsonpatch.noarch python26-jsonpointer.noarch python26-kitchen.noarch python26-libs.x86_64 python26-lockfile.noarch python26-markupsafe.x86_64 python26-paramiko.noarch python26-pip.noarch python26-ply.noarch python26-pyasn1.noarch python26-pycurl.x86_64 python26-pygpgme.x86_64 python26-pyliblzma.x86_64 python26-pystache.noarch python26-pyxattr.x86_64 python26-requests.noarch python26-rsa.noarch python26-setuptools.noarch python26-simplejson.x86_64 python26-six.noarch python26-urlgrabber.noarch python26-urllib3.noarch python26-virtualenv.noarch rpm-python26.x86_64

システムデフォルトのPythonを2.6へ切り替え

sudo alternatives --set python /usr/bin/python2.6