搜索
您的当前位置:首页正文

Centos7.5下安装python3.7

来源:知库网

一、安装开发者工具

yum -y groupinstall "Development Tools"
二、安装Python编译依赖包

yum -y install openssl-devel zlib-devel bzip2-devel sqlite-devel readline-devel libffi-devel systemtap-sdt-devel
三、下载安装包

tar zvxf Python-3.7.0.tgz
cd Python-3.7.0
./configure --prefix=/usr/local/python3.7 --enable-optimizations
make && make install
五、配置环境变量

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

if [ -z {PYTHON37_HOME}/bin:${PATH}
fi
六、加载环境变量

source /etc/profile.d/python37.sh
七、测试

python3 -c "import sys; print(sys.version)"

Top