很简单,但是每次安装都要现查,做个记录
cd /tmp wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz 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 mkdir /usr/local/python3 mv Python-3.6.7.tar.xz /usr/local/python3/ cd /usr/local/python3/ tar xf Python-3.6.7.tar.xz cd Python-3.6.7 ./configure --prefix=/usr/local/python3 make && make install ln -s /usr/local/python3/bin/python3 /usr/bin/python3 ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
验证:
python3 Python 3.6.7 (default, Aug 12 2019, 00:26:52) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> >>> >>>
原文:https://www.cnblogs.com/Go-Spurs-Go/p/11337435.html