安装python3.7依赖
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
在线下载Python3
创建文件夹,进入文件夹,下载
mkdir -p /usr/local/python3
cd /usr/local/python3/
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
查看有没有下载成功
[root@rzk python3]# ls
Python-3.7.4.tgz
编译
cd Python-3.7.4
./configure --prefix=/usr/local/python3
make && make install
修改环境
修改环境
[root@rzk bin]# vim ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/python3/bin 加上:/usr/local/python3/bin即可
保存退出
执行生效
[root@rzk bin]# source ~/.bash_profile
验证
/usr/local/python3/bin/python3.7
[root@rzk bin]# /usr/local/python3/bin/python3.7
Python 3.7.4 (default, Dec 23 2022, 11:37:33)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
标签:bin,3.7,devel,python3.7,usr,Linux,服务器,local,python3
From: https://www.cnblogs.com/rzkwz/p/17000395.html