2017年2月25日 星期六

[研究] Python 2.7 (yum)、3.4 (yum)、3.6 (tar.gz) 安裝 (CentOS 7.3)

[研究] Python 2.7 (yum)、3.4 (yum)、3.6 (tar.gz) 安裝 (CentOS 7.3)

2017-02-25

Python 2.7 yum 安裝

yum   -y   install python

測試

[root@localhost ~]# python
Python 2.7.5 (default, Nov  6 2016, 00:28:07)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
[root@localhost ~]# python  -V
Python 2.7.5
[root@localhost ~]#

********************************************************************************

Python 3.4.5 yum 安裝

http://dl.fedoraproject.org/pub/epel/7Server/x86_64/e/epel-release-7-9.noarch.rpm
rpm -Uvh epel-release-7-9.noarch.rpm
yum -y install python34

測試

[root@localhost ~]# python3  -V
Python 3.4.5

********************************************************************************

Python 3.6.0 (tar.gz) 安裝

cd /usr/local/src
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
tar zxvf  Python-3.6.0.tgz
cd  Python-3.6.0
./configure
make
yum -y install zlib zlib-devel

測試

[root@localhost Python-3.6.0]# python
Python 2.7.5 (default, Nov  6 2016, 00:28:07)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
[root@localhost Python-3.6.0]# python -V
Python 2.7.5

[root@localhost Python-3.6.0]# python3 -V
Python 3.6.0
[root@localhost Python-3.6.0]# python3
Python 3.6.0 (default, Feb 24 2017, 18:58:38)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
[root@localhost Python-3.6.0]#

(完)


沒有留言:

張貼留言