1、安装开发者工具yum -y groupinstall Development Tools2、安装Python编译依赖包yum -y install openssl-devel zlib-devel bzip2-devel sqlite-devel readline-devel libffi-devel systemtap-sdt-devel3、下...
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)"
本文标题为:CentOS 7.5 安装 Python3.7
基础教程推荐
- 四步教你学会打包一个新的Python模块 2022-10-20
- ubuntu 18 python3.6 的安装与 python2的版本切换 2023-09-03
- Centos7下安装python环境 2023-09-04
- python的环境conda简介 2022-10-20
- 基于Python实现股票数据分析的可视化 2023-08-04
- Python爬取当网书籍数据并数据可视化展示 2023-08-11
- centos系统 anaconda3(python3)安装pygrib 2023-09-04
- CentOS 7.5 安装 Python3.7 2023-09-03
- Python基础学习之函数和代码复用详解 2022-09-02
- Python 中 Elias Delta 编码详情 2023-08-08