-
安装依赖包
# yum -y groupinstall "Development tools" # 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
-
下载python3.7.5安装包
# wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tar.xz
-
安装python3
解压压缩包,进入解压目录,指定安装目录,安装Python3。
# yum install libffi-devel -y # tar -xvf Python-3.7.5.tar.xz # cd Python-3.7.5 # mkdir /usr/local/python3 # ./configure --prefix=/usr/local/python3 # make && make install
安装Python3时,会自动安装pip。假如没有,需要自己手动安装。
# yum -y install python-pip
-
创建软连接
# ln -s /usr/local/python3/bin/python3 /usr/bin/python3 # ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3