安装Python
安装python的依赖环境
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 gcc-c++ lsb libXScrnSaver wget
下载python压缩包
wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
解压压缩包
tar zxvf Python-3.8.1.tgz -C ./
进入到/usr下,创建python3目录
cd /usr
mkdir python38
再进入到解压后的Python-3.8.1目录下,进行安装配置
./configure --prefix=/usr/python38
开始安装
make && make install
进入/usr/python38目录,建立软连接
cd /usr/python38
ln -s /usr/python38 /usr/local/bin/python3
配置环境变量,执行vim /etc/profile,最后一行加上
PATH=/usr/python38/bin:$PATH
export PATH
网友评论