The python2.7 version is installed by default on CentOS7, and the 3.4 version is installed using yum install python34. This version will prompt when installing some software packages such as pip:
DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019(cf PEP 429).
Naturally, we want to install the higher version and need to install it manually.
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0b2.tgz
3.7.4 Use the link below
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4rc2.tgz
tar -zxvf Python-3.8.0b2.tgz
mkdir /usr/local/python3
# If there is no compilation environment, there will be an error message, the way to fix it is to install gcc or tool suite
[ root@ax Python-3.8.0b2]# ./configure --prefix=/usr/local/python3
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for python3.8... no
checking for python3... no
checking for python... python
checking for--enable-universalsdk... no
checking for--with-universal-archs... no
checking MACHDEP..."linux"
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error:in`/home/axing/Python-3.8.0b2':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
[ root@ax Python-3.8.0b2]# yum -y groupinstall "Development Tools"
# Recompile after installation
cd Python-3.8.0b2
. /configure --prefix=/usr/local/python3
make && make install
# Set soft link
[ [email protected]]# ln -s /usr/local/python3/bin/python3.8/usr/bin/python3
[ root@ax]# python3
Python 3.8.0b2(default, Jul 82019,12:01:59)[GCC 4.8.520150623(Red Hat 4.8.5-36)] on linux
Type "help","copyright","credits" or "license"for more information.>>>
Recommended Posts