内容字号:默认大号超大号

段落设置:段首缩进取消段首缩进

字体设置:切换到微软雅黑切换到宋体

CentOS7.5安装Python3.7

2018-09-12 11:08 出处:清屏网 人气: 评论(0

1.安装开发者工具

yum -y groupinstall "Development Tools"

2.安装Python编译依赖包

yum -y install openssl-devel zlib-devel bzip2-devel sqlite-devel readline-devel libffi-devel systemtap-sdt-devel

3.下载安装包

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

4.解压&编译

tar zvxf Python-3.7.0.tgz
cd Python-3.7.0
./configure --prefix=/usr/local/python3.7 --enable-optimizations
make && make install

5.配置环境变量

文件: /etc/profile.d/python37.sh

if [ -z ${PYTHON37_HOME} ]; then
    export PYTHON37_HOME=/usr/local/python3.7
    export PATH=${PYTHON37_HOME}/bin:${PATH}
fi

6.加载环境变量

source /etc/profile.d/python37.sh

7.测试

python3 -c "import sys; print(sys.version)"
分享给小伙伴们:
本文标签: CentOSPython

相关文章

发表评论愿您的每句评论,都能给大家的生活添色彩,带来共鸣,带来思索,带来快乐。

CopyRight © 2015-2016 QingPingShan.com , All Rights Reserved.

清屏网 版权所有 豫ICP备15026204号