A: python3 linux version of the official website to download the installation package
1: Create a directory to store the installation package
#mkdir /usr/python
#cd /usr/python
2: Download the installation package python3
Install wget command
#yum install wget
Download the installation package python3
3.7 official website address: https: //www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
#wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
II: Extracting installation packages, the installation python3
#tar -zxvf Python-3.7.0.tgz
Python3 installed to / usr / local / python3 directory (automatically created python3 under / usr / local directory)
#./configure --prefix=/usr/local/python3
Will be reported as an error, you need to install gcc environment
Install gcc environment
#yum install gcc
After installation is complete, execute on command:
#./configure --prefix=/usr/local/python3
Gcc will not report the error environment
Then we went to perform
#make
#make install
It may be error: zipimport.ZipImportError: can not decompress data; zlib not available
Solution:
#yum install zlib zlib-devel -y
carry on
#make
#make install
It may also be an error: ModuleNotFoundError: No module named '_ctypes'
Solution:
#yum install libffi-devel -y
After installation clear Cached
#make distclean
carry on
#make
#make install
To / usr / bin directory settings After successful installation soft connection point
# cd /usr/bin/
# ln -s /usr/local/python3/bin/python3.7 python3
If you enter # python3 command, as shown, so far, it is installed to python3!