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
    原文作者:luxesky
    原文地址: https://segmentfault.com/a/1190000012256213
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞