CentOS6.5下安装Python3.6.2

1.安装下列所需的依赖包: gcc zlib zlib-devel readline-devel

# yum install zlib-devel
# yum install readline-devel

注:readline-devel包用于解决退格键与方向键出现乱码的问题

2.下载python3.6.2安装包

# wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz

3.解压安装包

# tar -xzvf Python-3.6.2.tgz

4.进入目录

# cd Python-3.6.2

5.配置、检查依赖

# ./configure --prefix=/usr/local/python3

注:添加prefix前缀指定安装的目标路径

6.编译&安装

# make && make install

7.建立新的软链接

# ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3

8.测试运行

# python3 --version
# python3

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native